[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: file access time and file modification time
From: |
Chet Ramey |
Subject: |
Re: file access time and file modification time |
Date: |
Tue, 9 Jul 2019 14:11:41 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 |
On 7/9/19 12:12 PM, kfm@plushkava.net wrote:
>> The code just returns (atime <= mtime), and has since 1997. It uses the
>> st_atime and st_mtime fields. I should update it to use timespecs if
>> they're available, and (mtime > atime) might work closer to your
>> expectations.
>>
>> After the call to mktemp, the atime and mtime are the same, so the test
>> returns true.
>
> I see. Indeed, it is confusing to me because I would not consider a file
> whose atime and mtime are equal to have been "modified since it was last
> read", notwithstanding that the newborn file has not yet been read at all. I
> think that it would help for the documentation to address this nuance.
>
> As for the possibility of using the timespec fields, that would be terrific.
That's already done.
And we'll try the (mtime > atime) variant as well.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/