zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh workers <zsh-workers@sunsite.dk>
Subject: Re: PATCH: support for nanosecond timestamps
Date: Sun, 4 Nov 2007 17:14:56 +0000	[thread overview]
Message-ID: <20071104171456.5d873459.p.w.stephenson@ntlworld.com> (raw)
In-Reply-To: <23800.1193938673@thecus>

On Thu, 01 Nov 2007 17:37:53 +0000
Oliver Kiddle <okiddle@yahoo.co.uk> 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 <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


  parent reply	other threads:[~2007-11-04 17:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-01 15:40 Oliver Kiddle
2007-11-01 15:50 ` Stephane Chazelas
2007-11-01 17:37   ` Oliver Kiddle
2007-11-01 18:28     ` Stephane Chazelas
2007-11-04 17:14     ` Peter Stephenson [this message]
2007-11-05 14:45       ` Oliver Kiddle
2007-11-05 15:26         ` Stephane Chazelas
2007-11-05 15:31         ` Peter Stephenson
2007-11-04 16:46 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071104171456.5d873459.p.w.stephenson@ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).