-
Notifications
You must be signed in to change notification settings - Fork 7.3k
fs: remove fs.watchFile(), IOWatcher #3348
Comments
How hard would it be to write a stat poller as a userland module? It seems like something that could be done pretty easily in JS, actually. |
Not hard. A timer and |
can fs.watch still watch a file? What was the purpose of fs.watchFile over fs.watch? I guess the stat object is a nice to have. Wasn't there 3rd party modules that do inotify, etc for people that care about that? |
Yes,
Nothing, it predates |
I love that Node is still willing to make changes like this (i.e. doesn't keep old APIs around just for backward compat). <3 |
@domenic Well, we DO care about backwards compatibility. We ought to deprecate fs.watchFile in 0.9 and replace it with a stat poller. |
Well, the mdns addon relies on It would be awesome if you guys could add such a thing at some point in 0.9. |
I humbly disagree. If it works fine as an external module, then I see no reason for it to be in core. It's just more maintenance for the core team to deal with in the future. |
I use |
Also, with |
Just adding few notes: I think It's important to have alternative that does not eat file descriptors and also works in not persistent way. Currently I don't see a way how to build (with plain JS) stat poller that would also be not persistent, so hearing that |
@medikoo what exactly do you mean by persistent? I don't follow. |
@superjoe30 see
|
In general I agree with @TooTallNate. However, this one is a little bit different. The code wrapped by Loosing Although |
Closing. IOWatcher got removed in 2c5828b, fs.watchFile() is here to stay. |
IOWatcher
should be non-controversial, nothing is using it. I could patch it up to work with libuv's new poll API but I don't think there's much point.fs.watchFile()
is currently broken in master: it depends on libev behavior that's been supplanted by libuv. There's no fix except writing our own stat poller (possibly in JS). I move to remove it./cc @isaacs, @piscisaureus
The text was updated successfully, but these errors were encountered: