[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [coreutils] [PATCH 1/2] stat: support printing birthtime
From: |
Jim Meyering |
Subject: |
Re: [coreutils] [PATCH 1/2] stat: support printing birthtime |
Date: |
Fri, 01 Oct 2010 17:11:23 +0200 |
Eric Blake wrote:
...
> +# Whether birthtime is supported or not, it better not change even when
> +# [acm]time are modified. :)
> +touch a || fail=1
> +btime=$(stat --format %W a) || fail=1
> +atime=$(stat --format %X a) || fail=1
> +mtime=$(stat --format %Y a) || fail=1
> +ctime=$(stat --format %Z a) || fail=1
> +
> +case $(stat --format %x a) in
> + *.000000000*) sleep 2;; # worst case file system is FAT
> + *) # FIXME: sleep .1 would be sufficient if %X showed nanoseconds
> + sleep 1;; # should be adequate for any system with subsecond resolution
> +esac
We try hard to avoid sleeping in the common case.
Any reason not to do what the FIXME suggests?
case $(stat --format %X a) in
*.000000000) sleep 1;;
*) sleep .1;;
esac
> +touch a || fail=1
> +test "x$btime" = x$(stat --format %W a) || fail=1
> +test "x$atime" != x$(stat --format %X a) || fail=1
> +test "x$mtime" != x$(stat --format %Y a) || fail=1
> +test "x$ctime" != x$(stat --format %Z a) || fail=1
> +
> +Exit $fail
- Re: [coreutils] [PATCH 1/2] stat: support printing birthtime, Jim Meyering, 2010/10/01
- Re: [coreutils] [PATCH 1/2] stat: support printing birthtime, Eric Blake, 2010/10/01
- Re: [coreutils] [PATCH 1/2] stat: support printing birthtime, Pádraig Brady, 2010/10/01
- Re: [coreutils] [PATCH 1/2] stat: support printing birthtime, Eric Blake, 2010/10/01
- Re: [coreutils] [PATCH 1/2] stat: support printing birthtime, Eric Blake, 2010/10/01
- [coreutils] [PATCH] maint: update sample test template, Eric Blake, 2010/10/01
- Re: [coreutils] [PATCH] maint: update sample test template, Jim Meyering, 2010/10/01
- Re: [coreutils] [PATCH] maint: update sample test template, Eric Blake, 2010/10/01
- [coreutils] [PATCH] tests: output --version of program under test, Eric Blake, 2010/10/01
Re: [coreutils] [PATCH 1/2] stat: support printing birthtime,
Jim Meyering <=
Re: [coreutils] [PATCH 1/2] stat: support printing birthtime, Pádraig Brady, 2010/10/04
Re: [coreutils] [PATCH 1/2] stat: support printing birthtime, Jim Meyering, 2010/10/04