bug-findutils
[Top][All Lists]
Advanced

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

sub-second timestamp resolution for findutils 4.3.x


From: James Youngman
Subject: sub-second timestamp resolution for findutils 4.3.x
Date: Tue, 16 Jan 2007 20:23:18 +0000

For the past few days I have been working on a large change for
findutils 4.3.x.  This change provices full support for
nanosecond-resolution filesystem timestamps.  Previously, findutils
only supported one-second resolution timestamps (i.e. struct
stat.st_mtime and so on).

The work is not quite finished; important tests like -mtime, -ctime
and -atime son't yet support the additional resolution.  But other
stuff (for example -anewer and the various -printf formats) does work
already.

The attached patch represents the current state of play (I have not
yet committed it).    I would be grateful for any feedback you have on
it.   Much of this functionality is very difficult to test, and so
developing it is a painstaking experience.  I would be glad of any
comments you have to make on the code changes.

If you wish to test the patch, it should apply cleanly against the CVS
code for 4.3.x, and will probably apply against the 4.3.2 tarball,
too.   To get the most out of testing it, you will need to use a
filesystem with high-resolution filesystem timestamps.  I know that
ext3 on Linux doesn't have nanosecond timestamps but that JFS on Linux
does, and I believe that recent versions of Solaris (for quite old
values of 'recent') have that feature.

Thanks.

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

        (ctime_format): format the time manually (rather than using ctime)
        in order to include the sub-second part of the time.
        (weekdays, months): new static variables used by ctime_format.
        (format_date): append a the sub-second part of the timestamp to
        the seconds part of date/time output.
        
2007-01-15  James Youngman  <address@hidden>

        * find/defs.h (time_val): define struct; use timespec to hold time
        in the 'reftime' member.
        (args): use struct timespec instead of time_t for predicates
        -newer, -anewer, -cnewer.
       * find/parser.c (includes): include stat-time.h.
        (parse_anewer, parse_cnewer, parse_newer): use struct timespec to
        hold timestamps.  * find/pred.c (compare_ts): new function for
        comparing timestamps in struct timespec.
        (pred_anewer, pred_cnewer, pred_newer): use compare_ts() to
        compare timestamps (hence takinng acoung of sub-second
        granularity).
        * find/ftsfind.c: Various improvements to comments.
        (is_fts_enabled): Newline before function name to comply with GNU
        coding standard.

Attachment: findutils-4.3.x-subsecond.patch.gz
Description: GNU Zip compressed data


reply via email to

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