[Top][All Lists]

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

[bug#61240] improve high-res file timestamp in Automake

From: Paul Eggert
Subject: [bug#61240] improve high-res file timestamp in Automake
Date: Sat, 4 Feb 2023 17:56:05 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 2023-02-04 16:02, Jacob Bachmeyer wrote:
In any case, you will still need to account for the possibility that Time::HiRes::stat() might not actually have higher resolution, depending on the filesystem.

That's fine. All we want is the exact file timestamp. If the file system timestamp resolution is only 2 s, then we want that multiple of 2. Admittedly we can't get the exact file timestamp on many modern file systems since Time::HiRes is precise only to the nearest ~238 ns for today's timestamps, but the idea is to get what we easily can.

There are also the no-runtime-overhead options of using "eval { use Time::HiRes qw(stat) };" which will replace stat() with the hi-res version if it is available and continue with the regular stat() builtin if not, or "use constant HAVE_Time_HiRes => eval { use Time::HiRes };" and a conditional "if (HAVE_Time_HiRes) { ... } else { ... }" as I suggested as an improvement to Mike Frysinger's patch.

Sorry, I don't remember seeing that suggestion. I guess it was in another thread. Could you resend that patch to and cc me? Preferably a patch against the latest Automake, in "git format-patch" format; see <> for how to get bleeding-edge Automake. The idea would be to port bleeding-edge Automake to Perl < 5.10 when that's easy.

Please bear in mind that I stopped coding in Perl 30 years ago and so am a bit rusty.

reply via email to

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