Does fs.utimes
invoke utime()
or utimes()
?
#4610
Unanswered
jsumners-nr
asked this question in
Q&A
Replies: 0 comments 3 replies
-
No, is using I'll try to build the backtrace for you. uv_fs_utime calls an Which ends on Linux in a
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a test against
fs.utimes
that is flaky. The test:fs.utimes
against that file to set specific accessed & modified timesfs.utimes
viafs.statSync
This test is flaking out by the accessed time occasionally, being set to an unexpected time (creation time of the temp file?), e.g.
1732540522.827 == 1732539600
.This comment nodejs/node#30212 (comment) is suggesting that, ultimately, the passed in times are being converted to nanosecond precision. But if I look at:
https://github.com/nodejs/node/blob/b17a1fb1cec919c09aa3401c040b79e35c5ed82e/src/node_file.cc#L2934-L2965
it looks like Node.js will be invoking
utime()
instead ofutimes()
(at least, I think thatstatic void UTimes
function is what underliesfs.utimes
). According to https://linux.die.net/man/2/utimes, onlyutimes()
supports nanosecond precision.Is my finding correct? Or am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions