bug-bash
[Top][All Lists]
Advanced

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

Re: bash conditional expressions


From: L A Walsh
Subject: Re: bash conditional expressions
Date: Sat, 25 Dec 2021 22:04:09 -0800
User-agent: Thunderbird

On 2021/11/12 01:36, Mischa Baars wrote:
Hi All,

All of my makefiles only compile source files and link object files that
are NEW, as in the modification timestamp is newer than OR EQUAL TO the
access timestamp, such that when I include a new source file into a project
or produce a new object file during compilation of the project, it does not
take more time than required.
-----
   You realize the updating of the atime field is variable based on file
system mount options, like 'noatime', 'strictatime' 'relatime', 'atime'.

You mention bash's -N flag which compares mtime+atime, but more important to how
that works is how the file system is mounted.

If the defaults changed in your distribution, the behavior of bash's -N would
change as well, completely independent of bash.

If you are running on a file system mounted with 'noatime', bash's -N would be of little use... Not sure about the other atime variants. If you use 'strictatime' I'd expect it should work as you expect, but there are performance penalties with that.
Looking forward to a fix!
----
You might want to try 'strictatime' on your file systems where you need
strict behavior, but that does create a performance penalty across the whole
file system.

Better is to use bash's (-nt or -ot) That will compare modification fields and not suffer from 'atime' behavior differences.





reply via email to

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