Created
July 25, 2012 07:01
-
-
Save trentm/3174841 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@headnode (bh1-kvm7:0)]# cat foo.js | |
var fs = require('fs'); | |
fs.watch("/var/tmp/follow.log", {persistent: true}, function (event, filename) { | |
console.log("EVENT", event, filename); | |
}); | |
[root@headnode (bh1-kvm7:0)]# ./build/node/bin/node --version | |
v0.6.19 | |
[root@headnode (bh1-kvm7:0)]# uname -a | |
SunOS headnode 5.11 joyent_20120723T091636Z i86pc i386 i86pc | |
[root@headnode (bh1-kvm7:0)]# ./build/node/bin/node foo.js > foo.log | |
# Then in another terminal I ran: | |
[root@headnode (bh1-kvm7:0) /var/tmp]# echo foo >> follow.log | |
# ... then I ^C'd the "foo.js" run as fast as I could and: | |
[root@headnode (bh1-kvm7:0)]# wc -l foo.log | |
41468 foo.log | |
[root@headnode (bh1-kvm7:0)]# cat foo.log |uniq | |
EVENT change null | |
IOW, `fs.watch` is in an infinite loop. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment