findutils-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Findutils-patches] [PATCH] Indicate that %A@ now includes a fractional


From: James Youngman
Subject: [Findutils-patches] [PATCH] Indicate that %A@ now includes a fractional part.
Date: Sun, 1 Jul 2007 00:45:54 +0100

2007-07-01  James Youngman  <address@hidden>

        * doc/find.texi (Updating A Timestamp File): Indicate that %A@ now
        includes a sub-second part on many systems.
---
 doc/find.texi |   34 ++++++----------------------------
 1 files changed, 6 insertions(+), 28 deletions(-)

diff --git a/doc/find.texi b/doc/find.texi
index 113f82e..314dba7 100644
--- a/doc/find.texi
+++ b/doc/find.texi
@@ -4284,36 +4284,14 @@ value of @code{$newest} if that variable is set, but to
 @file{timestamp} otherwise.  This ensures that an argument is always
 given to the @samp{-r} option of the @code{touch} command.
 
-This approach seems quite efficient, but unfortunately it has a bug.
-Many operating systems now keep file modification time information at
-a granularity which is finer than one second.  Unfortunately the
address@hidden@@} format for @samp{-printf} only prints a whole-number value
-currently; that is, these values are at a one-second granularity.
-This means that in our example above, @samp{$newest} will be the name
-of a file which is no more than one second older than the newest file,
-but may indeed be older.
+This approach seems quite efficient, but unfortunately it has a
+problem.  Many operating systems now keep file modification time
+information at a granularity which is finer than one second.
+Findutils version 4.3.3 and later will print a fractional part with
+%A@, but older versions will not.
 
-It would be possible to solve this problem with some kind of loop:
 
address@hidden
-while true; do
-        newest=$(find subdir -newer timestamp -printf "%A@@:%p\n" | 
-           sort -n | 
-           tail -1 | 
-           cut -d: -f2- ) 
-        if test -z "$newest" ; then
-                break
-        else
-                touch -r "$newest" timestamp
-        fi
-done
address@hidden smallexample
-
-A better fix for this problem would be to allow the @samp{%A@@} format
-to produce a result having a fractional part, too.  While this is
-planned for GNU @code{find}, it hasn't been done yet.
-
address@hidden Coping with sub-second timestamp resolution
address@hidden Solving the problem with make
 
 Another tool which often works with timestamps is @code{make}.  We can
 use @code{find} to generate a @file{Makefile} file on the fly and then
-- 
1.5.2.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]