zsh-workers
 help / color / mirror / code / Atom feed
From: dana <dana@dana.is>
To: Vincent Lefevre <vincent@vinc17.net>
Cc: zsh-workers@zsh.org
Subject: Re: zsh/stat: output atime/mtime/ctime with nanoseconds
Date: Tue, 19 Jun 2018 12:32:19 -0500	[thread overview]
Message-ID: <40B18898-FFE4-4AB6-9146-1DF758878480@dana.is> (raw)
In-Reply-To: <20180619141851.GA16101@zira.vinc17.org>

On 19 Jun 2018, at 09:18, Vincent Lefevre <vincent@vinc17.net> wrote:
>Under Linux, the stat utility from GNU Coreutils outputs
>atime/mtime/ctime with nanoseconds.
>
>IMHO, zsh should do the same.

The GNU tools that support nanoseconds in time strings tend to use Gnulib's
nstrftime(), which provides their %N extension to the standard strftime(3)
stuff.

zsh has a similar function, ztrftime(), which zsh/stat uses. The first problem
is that the module doesn't pass the file's sub-second time information to the
function, and the second problem is that, even if it did, ztrftime() only
supports microsecond granularity. I think it would be very easy to change both
of those things, but there may be some portability issues with getting the
nanosecond information itself.

(Also, not all file systems even record times to the nanosecond — HFS+ only has
whole-second granularity for example — but that's another thing.)

If nobody has any objections i might look into this later; there've been a few
times i wanted '%9.' myself.

dana


  reply	other threads:[~2018-06-19 17:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19 14:18 Vincent Lefevre
2018-06-19 17:32 ` dana [this message]
2018-06-19 19:17 ` Oliver Kiddle
2018-06-20  5:12   ` dana

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=40B18898-FFE4-4AB6-9146-1DF758878480@dana.is \
    --to=dana@dana.is \
    --cc=vincent@vinc17.net \
    --cc=zsh-workers@zsh.org \
    /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).