bug-findutils
[Top][All Lists]
Advanced

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

Re: Imprecision in documentation of -newer


From: Bernhard Voelker
Subject: Re: Imprecision in documentation of -newer
Date: Sat, 21 Nov 2020 16:18:11 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3

On 11/21/20 2:18 PM, Reuben Thomas via Bug reports for the GNU find utilities 
wrote:
> The manual (current git) says:
> 
> True if the time of the last access (or status change or data modification)
>> of the current file is more recent than that of the last data modification
>> of the @var{reference} file.
>>
> 
> Presumably it really means:
> 
> True if the time of the last access (or status change or data modification)
> of the current file is more recent than that of the @var{reference} file.
> 
> In other words, like is compared with like, it's not always the mtime of
> the reference file that is used.

Yes, it is: the code uses get_stat_mtime() on the reference file
for all 3 variants:

* parse_anewer:
  
https://git.savannah.gnu.org/cgit/findutils.git/tree/find/parser.c?id=cc5d59382f#n790

* parse_cnewer:
  
https://git.savannah.gnu.org/cgit/findutils.git/tree/find/parser.c?id=cc5d59382f#n825

* parse_newer:
  
https://git.savannah.gnu.org/cgit/findutils.git/tree/find/parser.c?id=cc5d59382f#n1513

As such, the documentation is correctly describing find's behavior.

-anewer and -cnewer are a GNU extension, so it's not specified by POSIX
how find should behave.

FWIW: it seems e.g. FreeBSD's find behaves the same.

Have a nice day,
Berny





reply via email to

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