From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27059 invoked from network); 4 Nov 2007 17:15:24 -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.5 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; 4 Nov 2007 17:15:24 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 19201 invoked from network); 4 Nov 2007 17:15:18 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Nov 2007 17:15:18 -0000 Received: (qmail 929 invoked by alias); 4 Nov 2007 17:15:14 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24056 Received: (qmail 911 invoked from network); 4 Nov 2007 17:15:13 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Nov 2007 17:15:13 -0000 Received: (qmail 18774 invoked from network); 4 Nov 2007 17:15:13 -0000 Received: from mtaout03-winn.ispmail.ntl.com (81.103.221.49) by a.mx.sunsite.dk with SMTP; 4 Nov 2007 17:15:07 -0000 Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com with ESMTP id <20071104171505.NCBA26125.mtaout03-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com> for ; Sun, 4 Nov 2007 17:15:05 +0000 Received: from pws-pc.ntlworld.com ([81.107.45.67]) by aamtaout04-winn.ispmail.ntl.com with SMTP id <20071104171505.LBRB29112.aamtaout04-winn.ispmail.ntl.com@pws-pc.ntlworld.com> for ; Sun, 4 Nov 2007 17:15:05 +0000 Date: Sun, 4 Nov 2007 17:14:56 +0000 From: Peter Stephenson To: Zsh workers Subject: Re: PATCH: support for nanosecond timestamps Message-Id: <20071104171456.5d873459.p.w.stephenson@ntlworld.com> In-Reply-To: <23800.1193938673@thecus> References: <22003.1193931601@dcle12> <20071101155035.GA27981@sc.homeunix.net> <23800.1193938673@thecus> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.14; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 01 Nov 2007 17:37:53 +0000 Oliver Kiddle wrote: > Stephane Chazelas wrote: > > What about returning floating point numbers for zstat? > > I've just looked at the documentation for stat to see how that might > work. It'd end up returning the string representation rather than a float > given the current interface. What exactly were you envisaging? It might > be more useful to have it available with the -F (format) option. The only > trouble there is that there is no standard for the letters to use in the > format specifiers. date(1) on Linux has %N for nanoseconds. %N seems reasonable, although I'm wondering if we might actually be better off with a specification for floating point seconds; we could then use the same thing in zsh/datetime where we only get microsecond resolution from gettimeofday(). Either way, it would probably be good to add this to ztrftime() and expand the interface to include a (possibly NULL) pointer to whatever gives the extra resolution. Would it be too horrible to allow formats like "%.9s"? We'd have to restrict it to %S and %s which are the only two where it makes sense, and we would have to decide what to do about E and O modifiers and glibc flag additions; simply passing them straight through and not allowing a fractional second in such cases would probably be good enough. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/