-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.dest
: mtime/atime lose sub-second precision
#124
Comments
@erikkemperman in the linked node issue, it says there is a caveat of filesystems that don't support subsecond resolution. What does |
@phated I think he's just saying that using |
I'll try to run the tests on windows to see what happens. Think I have a VM lying around somewhere. |
With a FAT partition? NTFS would not have this problem, right? I'm curious how that turns out. My guess is it will just work as if every read/write happened at precisely .000 millis, which is pretty much what it did before my patch. |
Blah, no luck with that VM. I'm going to get this merged under the assumption it just rounds 😛 |
Probably not too many people use an fs which might be affected...? Famous last words. Anyway, great if it got merged! |
@erikkemperman just needs a rebase (commented on PR) |
Closed by #125 - grouping some other fixes in a release. |
When
.dest
writes to file, the atime and mtime get rounded (well, floored) to seconds, even when the filesystem supports subsecond precision.Example
gulpfile.js
:the above would output something like this:
This is problematic when using plugins like
gulp-changed
orgulp-newer
, e.g. when we want to copy source files to a dist directory only if they've changed.I've tracked this down to the fact that
fs.utimes
is called. Apparently the problem would go away iffs.futimes
were called, see here. I just did some quick-and-dirty experimenting which confirms that this is the case.Even better, I suppose, would be to fix
utimes
, see here, but I think that might not happen any time soon.I'd be willing to make a PR which would make
vinyl-fs
usefutimes
but wanted to check first if this sounds like a good idea, or maybe there might be other solutions I'm overlooking.The text was updated successfully, but these errors were encountered: