Skip to content

Instantly share code, notes, and snippets.

@dlmanning
Last active December 23, 2015 09:59
Show Gist options
  • Save dlmanning/6618028 to your computer and use it in GitHub Desktop.
Save dlmanning/6618028 to your computer and use it in GitHub Desktop.
Possible regression between 0.10.16 and 0.10.17 related to libuv patch
Running watch.js on node 0.10.17 and OS X 10.8.5 gives the following when editing (in Sublime Text) and saving file in the same directory:
change : a.txt
rename : .subl319.tmp
change : a.txt
rename : .subl69d.tmp
etc...
Doing the same on 0.10.18 gives:
rename : .subl738.tmp
rename : .sublade.tmp
The same issue occurs between 0.11.6 and 0.11.7. Based on the commit log I think it's related to the following change in libuv:
https://github.com/joyent/libuv/commit/9bae606d413327187828155b61babcd52b2d2517
var fs = require('fs');
fs.watch(__dirname, function (evt, filename) {
console.log(evt + ' : ' + filename);
})
@jarofghosts
Copy link

For posterity, it seems to me that any change that occurs within ~200ms of another does not get emitted.. writing a test.

@dlmanning
Copy link
Author

@dlmanning
Copy link
Author

Turns out this was "fixed" when libuv 0.10.18 was rolled into node 0.10.21

joyent/libuv@38df93c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment