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
- X-seq: zsh-users 12030
- From: "Nikolai Weibull" <now@xxxxxxxx>
- To: "Richard Hartmann" <richih.mailinglist@xxxxxxxxx>
- Subject: Re: Failing to write to history file if containing directory doesn't exist
- Date: Wed, 17 Oct 2007 15:24:16 +0200
- Cc: "Matthew Wozniski" <godlygeek@xxxxxxxxx>, zsh-users@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=UMLLZ4iYysyUe/9ZaakXHsdnX0wup+6uSulFGEKyGdg=; b=OV8/kHR58xUfjK73ZqOXP6qJEkhFos3fx1AjF9hAcHAQXuzBKNEOW92vevR8DR6TUnxVLUN2Hc8XOv9CyL2/dAKRGxz2acXV/gwMbUMAb/lSgs0wE0t8Y+F+ym97XWeeOO+sxVABlUPq5c1g1vfDx6rs+5I9h4FhuWrlw9+lLEs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=gvTLulj/4YRpT2Ipb8WGPHg3Q09XxDVODo3MhfpVoTTKKuYrLHDG3gyB5vS7m94rHxqPd46bkI35bym/00KVPg3kbn21yD/hRGfNeBLv6CSu/BnLv+KVh/rUF41yRhJrP8YRvzt/+TJByxh5IDv52v72c5ho4DLiJJm+53dS0O8=
- In-reply-to: <2d460de70710170507j2317dab0r1440591912773b41@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <200710081338.l98Dc2br012284@xxxxxxxxxxxxxx> <20071008151949.GA18576@mastermind> <dbfc82860710080830r289c962eyde18f1564e7f0de0@xxxxxxxxxxxxxx> <20071008154632.GB18576@mastermind> <dbfc82860710081532m5672197crf568b7d120ab192f@xxxxxxxxxxxxxx> <071008184445.ZM25513@xxxxxxxxxxxxxxxxxxxxxx> <20071009015814.GA21038@mastermind> <2d460de70710170416i10627e1epc1f20811bc62859e@xxxxxxxxxxxxxx> <20071017114751.GB13054@mastermind> <2d460de70710170507j2317dab0r1440591912773b41@xxxxxxxxxxxxxx>
- Sender: nikolai.weibull@xxxxxxxxx
On 10/17/07, Richard Hartmann <richih.mailinglist@xxxxxxxxx> wrote:
> On 17/10/2007, Matthew Wozniski <godlygeek@xxxxxxxxx> wrote:
> > But, either way, I'm still against this proposed feature; I still find it
> > to be unnecessary at best.
> I would not want to use it, either. My comments are more geared towards
> 'if one would do it, this could be a good way'.
I still haven't seen a good reason for Zsh to not deal with this error
condition appropriately, besides worries that Zsh start creating
directories. This argument fails, because we actually asked it to
store a file in that directory, so we probably won't mind if Zsh makes
sure it exists when it's needed.
> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author