-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
fs.watchFile calling listener on non-existing files #1745
Comments
There is a fix pending here: nodejs/node-v0.x-archive#25469 |
Previously, fs.watchFile() would call the callback even if the file does not exist. This is erroneous and is fixed by correctly handling the error code provided. Ref: nodejs/node-v0.x-archive#25469 Fixes: nodejs#1745
@kanongil according to some discussion (#2028 (comment)), some believe that this should be the correct functionality. Do you have an opinion on that? |
When fs.watchFile encounters an ENOENT error, it invokes the given callback with some error data. This caused an issue as it was different behaviour than Node v0.10. Instead of changing this behaviour, document it and add a test. Ref: nodejs#1745 Ref: nodejs#2028
When fs.watchFile encounters an ENOENT error, it invokes the given callback with some error data. This caused an issue as it was different behaviour than Node v0.10. Instead of changing this behaviour, document it and add a test. Ref: #1745 Ref: #2028 Reviewed-By: Ben Noordhuis <[email protected]> PR-URL: #2093
@kanongil As per the discussion here, the current behaviour is preferred. And the doc improvement is done in #2093 and #2169. Please feel free to review them and suggest changes. I am closing this issue now. Please leave a comment if you strongly feel that this has to be reopened and discussed further. Thanks :-) |
fs.watchFile
is supposed to call the listener when the file attributes change. If I call it using a non-existing path, the listener is immediately fired for some reason.In node 0.10, it would wait until the file exists before calling the listener. The current functionality does however match node 0.12 behavior, which I filed an issue again here: nodejs/node-v0.x-archive#25345.
The text was updated successfully, but these errors were encountered: