Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Failing to write to history file if containing directory doesn't exist



On 10/8/07, Peter Stephenson <pws@xxxxxxx> wrote:

> Nikolai Weibull wrote:

> > > I'd have thought it was a reasonable expectation that the directory
> > > already existed.  You can always add "mkdir -p ${HISTFILE:h}" when you
> > > set HISTFILE, if you need to.

> > Yes, sure, but if we assume that this isn't always the case, would
> > code that dealt with this case be interesting for inclusion?

> I'm frankly lukewarm about adding code for stuff that can already be
> done in shell code if you need it, but if you think this is likely to
> happen in practice I'll add your C code.

I was guessing as much.  It's not a condition that comes up often.

I discovered this "problem" when I set up a new account for myself on
a new system.  I have HISTFILE set to  "~/.local/var/lib/zsh/history"
in an attempt at making my home directory somewhat Filesystem Hierachy
Standard "compliant".  Now "~/.local/var/lib" existed, but zsh wasn't
there.  Thus Zsh failed to open the history file.

[1] http://www.pathname.com/fhs/pub/fhs-2.3.html



Messages sorted by: Reverse Date, Date, Thread, Author