From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24358 invoked from network); 17 Oct 2007 12:07:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Oct 2007 12:07:30 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 46012 invoked from network); 17 Oct 2007 12:07:22 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Oct 2007 12:07:22 -0000 Received: (qmail 4142 invoked by alias); 17 Oct 2007 12:07:13 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12027 Received: (qmail 4128 invoked from network); 17 Oct 2007 12:07:12 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 17 Oct 2007 12:07:12 -0000 Received: (qmail 44834 invoked from network); 17 Oct 2007 12:07:12 -0000 Received: from py-out-1112.google.com (64.233.166.178) by a.mx.sunsite.dk with SMTP; 17 Oct 2007 12:07:06 -0000 Received: by py-out-1112.google.com with SMTP id y63so4334539pyg for ; Wed, 17 Oct 2007 05:07:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=REUYtZLDSn8V8YloLIUWO6NA35x4aTzu71EreJEIRps=; b=ESVAZMjxY5NITQeM7TvmKch52AwRKSDY1I49qUzJyPWprtgfxmwmz5UIF5Q5K17P7BBpjHoaHRdEobML6yjR3jkfxI3M4v/mNfO6A7gKPpehIstdbQsIMCU65i6DYtgqxCUNbbb+1O5EvGMNDUCYexmK8sT5yi+l+0PJifsT5JM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=FtKvsMNjxWNdicB7pk6UmiHl8KAU9Y53wt69ooMdzXYT6n7Rd9LksL7E9rVcjzrGiDT/7X5QEt5M7RS6t2bl6qJIgAZ/o7Oke9u/wsPOIh02oIDqbgh+B2gGOQJs+zqQmMxQ1qOIs8qxhgiLhPHK5AAwTU3sL8dPQtZnHmNKL+w= Received: by 10.65.83.18 with SMTP id k18mr16285637qbl.1192622824989; Wed, 17 Oct 2007 05:07:04 -0700 (PDT) Received: by 10.65.107.13 with HTTP; Wed, 17 Oct 2007 05:07:04 -0700 (PDT) Message-ID: <2d460de70710170507j2317dab0r1440591912773b41@mail.gmail.com> Date: Wed, 17 Oct 2007 14:07:04 +0200 From: "Richard Hartmann" To: "Matthew Wozniski" Subject: Re: Failing to write to history file if containing directory doesn't exist Cc: zsh-users@sunsite.dk In-Reply-To: <20071017114751.GB13054@mastermind> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200710081338.l98Dc2br012284@news01.csr.com> <20071008141403.GA25326@scowler.net> <20071008151949.GA18576@mastermind> <20071008154632.GB18576@mastermind> <071008184445.ZM25513@torch.brasslantern.com> <20071009015814.GA21038@mastermind> <2d460de70710170416i10627e1epc1f20811bc62859e@mail.gmail.com> <20071017114751.GB13054@mastermind> On 17/10/2007, Matthew Wozniski wrote: > > Perhaps check when the shell starts and in the history write function. > > precmd should be as light as possible. > > As Bart noted earlier in this thread, history writes occur once per > command anyway for users with SHARE_HISTORY or INC_APPEND_HISTORY set. Yah, that is why I worded it that way :) > And a solution handled during a history write can't be handled > directly in shell code. That's exactly what my suggestion was aimed > at avoiding. The only advantage I can see to handling it in C would > be that it would add only one extra instruction for an unexceptional > write (if (errno != ...) ) instead of the full cost of a glob and > a parameter expansion, which are presumably much more expensive. Exactly. To me, the only clean solution would be a new option. > 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'. 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 Richard > > ~Matt >