Using times like 201709132359.59 is exactly substracting one
system-dependend clock tick.
Shortly, it would be nice to have all six comoarision operators
(newer, not newer, older, not older, equal, not equal), not only the
first two.
As one of the compared values is a parameter and another is found
file, there is no way to swap them and get "older" out if "newer", so
all six are needed

On 9/28/17, Steven M. Schweda <s...@antinode.info> wrote:
> From: anonymous <invalid.nore...@gnu.org>
>
>> 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               s...@antinode.info
>

Reply via email to