Zsh Mailing List Archive
Messages sorted by:
Re: Failing to write to history file if containing directory doesn't exist
- X-seq: zsh-users 11968
- From: "Nikolai Weibull" <now@xxxxxxxx>
- To: "Matthew Wozniski" <godlygeek@xxxxxxxxx>
- Subject: Re: Failing to write to history file if containing directory doesn't exist
- Date: Tue, 9 Oct 2007 00:32:53 +0200
- Cc: 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=0KimyIoR1kd1wkv9RDQliuumLrY5L1sGjY70KDBKciY=; b=p4MnLKAT2m+N+LbK8i5xZnPyXkz4qDJAjpLNlpGd+rBC98Vs/+8PuMocSmQXOzm/PM/A8DxHZk4wUjz+mxae1zVvvGjz96TJWlx+YnhksX9YYFCr9H68H93HIhCRYndFC6nNtjSsKjQXwCBK3zVHBaDmAwvhbSqaQfl1OhNz6z4=
- 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=MUCWTZdID2Na2/yHDvaTravEEoYJenwtX+YH0A+0ePPWub9q3POSTl+1L1vYhXqmKyRVNUeLB5jrqzFjUzlquEWWBWw5Lvxpf6Wiqu27GKsEZ0WLbaNQQkWuhgz3lyXjtUPc5E+4VgjyPR1kUh/pvlcTy9uFmTzuu27fc9bg/3g=
- In-reply-to: <20071008154632.GB18576@mastermind>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <dbfc82860710080309m41cfa984q5aa0474c6b4bdf62@xxxxxxxxxxxxxx> <200710081015.l98AFlIU018448@xxxxxxxxxxxxxx> <dbfc82860710080508o3ef1de0br957caf39bb2aa19f@xxxxxxxxxxxxxx> <200710081338.l98Dc2br012284@xxxxxxxxxxxxxx> <dbfc82860710080705w6e90db9i2a9714caf27460c4@xxxxxxxxxxxxxx> <20071008141403.GA25326@xxxxxxxxxxx> <20071008151949.GA18576@mastermind> <dbfc82860710080830r289c962eyde18f1564e7f0de0@xxxxxxxxxxxxxx> <20071008154632.GB18576@mastermind>
- Sender: nikolai.weibull@xxxxxxxxx
On 10/8/07, Matthew Wozniski <godlygeek@xxxxxxxxx> wrote:
> On Mon, Oct 08, 2007 at 05:30:08PM +0200, Nikolai Weibull wrote:
> > And what if the directory gets deleted between the time HISTFILE is
> > set and the shell exits?
> The only way that should ever happen is if the user removed (or moved)
> the directory himself. If that's the case, the shell should certainly
> not recreate a directory that the user intentionally deleted, each and
> every time the history is updated. That would make it impossible for
> a user with HISTFILE=~/.zsh/history to do something as simple as:
> % mv .zsh .zsh-4.3.4
> % ln -s .zsh-4.3.4 .zsh
> without first unsetting and later setting HISTFILE, since the
> directory would be recreated between the two commands.
Only under the condition that HISTFILE is written to between the two commands.
> > I'd rather err on the side of a more intelligent, "work hard for the
> > user"-type shell that doesn't let my data disappear out into oblivion
> > without doing its best to keep said data around.
> But really, you're talking about recreating a directory that was just
> deleted. In this case we really ought to err on the principle of
> least surprise. After all, that directory didn't just get up and walk
> away, someone had to delete it. ;)
What if someone figured that it'd be easier to
% rm -r ~/.local/var/zsh
% rm ~/.local/var/zsh/history
(if, for example, ~/.local/var/zsh contains other transient data to be removed).
I still want to play a "don't lose data without trying to save it"
card, but it seems I'm the only one playing cards of that suite.
Messages sorted by: