-
-
Notifications
You must be signed in to change notification settings - Fork 37.3k
utimes doesn't seem to support subseconds times #22070
Copy link
Copy link
Closed
Labels
fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.
Description
Activity
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.
Not sure if it's an implementation issue or a documentation issue, but the following is unexpected:
As you can see, the precision is lost (my systems support subsecond precisions -
touchmanages to change them, and both thestatutility andfs.statcan read them without issues).The Node documentation also doesn't mention that
utimeshas a different behavior fromfutimes(it actually suggest they share the exact same behavior, sincefutimesredirect toutimes), except possibly in this archived post.Additionally, the function name (
utimes) seem to match the behavior of 2utimeinstead of 3utimes, which seems counterintuitive. The libuv implementation is calleduv_fs_utime, which at least hints at the difference of behavior (except that they useuv_fs_futimeinstead ofuv_fs_futimes..).