bug-findutils
[Top][All Lists]
Advanced

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

Re: [bug #52129] find lacks "-older" option symmetric to "-newer"


From: Steven M. Schweda
Subject: Re: [bug #52129] find lacks "-older" option symmetric to "-newer"
Date: Thu, 28 Sep 2017 13:57:00 -0500 (CDT)

From: anonymous <address@hidden>

> find lacks "-older" option symmetric to "-newer"
> 
> It is not the same as "-not -older", especially on the OSes without
> microsecond file times (such as Darwin) where equal file times are not
> seldom.
> 
> See the discussion here: https://github.com/NixOS/nixpkgs/pull/29825

   For those who are not familiar with it, VMS has a scheme (which may
date back forty years) for similar options, common to many commands. 
HELP DIRECTORY, for example, includes:

DIRECTORY

  /BEFORE

        /BEFORE[=time]

     Selects only those files dated prior to the specified time.
     You can specify time as an absolute time, as a combination of
     absolute and delta times, or as one of the following keywords:
     BOOT, LOGIN, TODAY (default), TOMORROW, or YESTERDAY. Specify
     one of the following qualifiers with the /BEFORE qualifier
     to indicate the time attribute to be used as the basis for
     selection: /BACKUP, /CREATED (default), /EXPIRED, or /MODIFIED.

     For complete information on specifying time values, see the
     OpenVMS User's Manual or the online help topic Date.

and:

DIRECTORY

  /SINCE

        /SINCE[=time]

     Selects only those files dated on or after the specified time.
[... continues as above ...]

   The key phrases are "dated prior to" and "dated on or after".  One
assumes that adding "-before" and "-since" here would be too much to
hope for, but something like "-newas" might be more useful than
"-newer", especially around midnight.  For example, see a recent
discussion involving HP-UX:

      https://community.hpe.com/t5/x/x/m-p/6976518

where the following suggestion was made:

      touch -t 201709130000.00 start-time
      touch -t 201709132359.59 end-time
      find . -type f -newer start-time ! -newer end-time -exec ls -lt {} \;

   A little care taken (actual design?) when designing such options
might spare the victims from atrocities like "2359.59", especially when
the time resolution on different file systems can differ.  Having to
create a file to specify a date-time is lame enough.  Having also to
subtract one (local) clock-tick from the desired date-time is one
crime-against-humanity too far.  (I claim.)

------------------------------------------------------------------------

   Steven M. Schweda               address@hidden



reply via email to

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