Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Allow microsecond resolution in fs.utimes? #1371

Closed
joliss opened this issue Jul 15, 2014 · 4 comments
Closed

Allow microsecond resolution in fs.utimes? #1371

joliss opened this issue Jul 15, 2014 · 4 comments

Comments

@joliss
Copy link

joliss commented Jul 15, 2014

Node's fs.utimes currently only supports 1-second-resolution time (see fs.c:580), making the round-trip to fs.stat lossy.

It seems we might be able to use the utimes system call instead of utime to get microsecond resolution.

@tjfontaine points out that you can use fs.futimes as a workaround. However, this still doesn't cover the case where we want to set the time on directories, because mkdir doesn't give us a file descriptor. So now I'm sad about the lack of microsecond resolution.

@saghul
Copy link
Contributor

saghul commented Jul 15, 2014

Do you have any proposal in mind?

@joliss
Copy link
Author

joliss commented Jul 16, 2014

I don't know the code well enough, unfortunately.

@txdv
Copy link
Contributor

txdv commented Jul 17, 2014

There is no need to know the code.

grep utime -r src/unix/

Change to utimes, make it compile, add test case, make pull request.

@saghul
Copy link
Contributor

saghul commented Nov 26, 2014

No follow-up, closing. Please open a PR in libuv/libuv if any of you want to work on this.

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

No branches or pull requests

3 participants