Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Node 0.12.0: fs.utimes does not set sub-second time on windows #9369

Closed
julien33 opened this issue Mar 10, 2015 · 2 comments
Closed

Node 0.12.0: fs.utimes does not set sub-second time on windows #9369

julien33 opened this issue Mar 10, 2015 · 2 comments
Labels

Comments

@julien33
Copy link

After switching from node 0.10.36 to 0.12.0 under windows, the function fs.utimes is setting only the time in seconds and not setting the milliseconds.

I tried to copy the time from one file to another, to implement a cache system, but even if the src file time is something like 1425996399750 (1425996399 seconds and 750 milliseconds), once I've called utimes on the dest file, its atime/mtime is set to 1425996399000 (1425996399 seconds and 0 milliseconds).

I've seen a potential source of the problem in https://github.com/libuv/libuv file src/unix/fs.c function uv__to_stat, but it might also be caused by node itself.

@ivan
Copy link

ivan commented Jun 25, 2015

I don't think this is a Windows-only problem. I see the same loss of milliseconds on Ubuntu with io.js 2.3.0 and iojs@90c72d4419af212e81a6e53f00ef02003e30e0c8.

See joyent/libuv#1371 and #7000

@cdubois
Copy link

cdubois commented Jul 26, 2016

This is an issue for both Linux and Windows. I just confirmed this with Ubuntu 14.04 and 16.04 running Node 6.3.1 distro from NodeSource. Perhaps this would get more attention if "windows" was removed from the issue title and more platform labels were added.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants