[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [coreutils] [PATCH 1/2] stat: support printing birthtime
From: |
Pádraig Brady |
Subject: |
Re: [coreutils] [PATCH 1/2] stat: support printing birthtime |
Date: |
Fri, 01 Oct 2010 01:43:00 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 |
On 01/10/10 00:32, Eric Blake wrote:
> * src/stat.c (print_stat): New %w and %W formats.
> (do_stat): Include %w in verbose format.
> (usage): Document them.
> * doc/coreutils.texi (stat invocation): Likewise.
> * NEWS: Likewise.
> Suggested by Andre "Osku" Schmidt.
> ---
>
> I've tested that this works on cygwin. On Fedora 13 with an
> ext4 partition, the birthtime appears to not be returned in
> stat(). If the kernel guys will ever commit to a stable
> xstat() interface, which we can then write gnulib wrappers
> for, we can use that instead. I'm assuming this will also
> work on BSD systems, although I have not yet tested that.
>
> I wasn't sure how to write a test for this - how to tell if
> a filesystem has birthtime support exposed by the kernel?
> Ideas on that front are welcome.
>
> For an example of what it looks like on a file system with
> all four times:
>
> $ src/stat ChangeLog
> File: `ChangeLog'
> Size: 496660 488 IO Block: 65536 regular file
> Device: 10897b43h/277445443dInode: 562949954522488 Links: 1
> Access: (0644/-rw-r--r--) Uid: ( 1007/ eblake) Gid: ( 513/ None)
> Access: 2010-09-30 16:58:48.859000000 -0600
> Modify: 2010-09-30 16:52:50.000000000 -0600
> Change: 2010-09-30 16:58:06.176250000 -0600
> Birth: 2010-09-30 16:58:06.098125000 -0600
So by default on Linux we'll get:
Birth: -
Might it be better to suppress the line if not present
given it's lack of support by file systems?
> + %x Time of file birth, or - if unknown\n\
> + %X Time of file birth as seconds since Epoch, or - if unknown\n\
s/x/w/
cheers,
Pádraig.