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 Wed, Oct 17, 2007 at 03:24:16PM +0200, Nikolai Weibull wrote:
> On 10/17/07, Richard Hartmann <richih.mailinglist@xxxxxxxxx> wrote:
> > An easy, light and scriptable solution that solves 99% of all cases has
> > already been hinted at:
> >
> > export HISTDIR=foo
> > mkdir -p $HISTDIR || echo 'Woe is me!'
> > export HISTFILE=$HISTDIR/bar
> 
> I'm sorry, but how does it solve 99% of all cases?  There are two cases:
> 
> 1.  $HISTFILE:h exists when writing $HISTFILE
> 2.  $HISTFILE:h does not exist when writing $HISTFILE
> 
> The above solution makes case 1 more likely, sure, but it doesn't solve case 2.

I don't believe case 2 to be a problem.  That directory didn't just
disappear, it was removed.  You told zsh to write to $HISTFILE, then
you removed $HISTFILE:h, and now zsh can't write to $HISTFILE anymore:
in what way is that behavior unexpected or undesirable?  I still don't
see it.

~Matt



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