-
Notifications
You must be signed in to change notification settings - Fork 30k
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
doc: added note to fs.watchFile on previousStat #16099
Conversation
Explains the expected behavior of previousStat in fs.watchFile() when a watched file disappears and reappears. Fixes: nodejs#15364
doc/api/fs.md
Outdated
In such cases the reappearance callback will not report the `previousStat` of | ||
the file with all zeroes. This is the correct and expected behavior for | ||
`uv_fs_poll_start()`, the libuv function that `fs.watchFile()` uses internally. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is documented under Appendfile
, as opposed to watchFile
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gireeshpunathil Corrected. Thanks for pointing that out! It would be great if you could please review again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, thanks!
Note was previously mistakenly added under fs.appendFile() section. Now moved to correct position, under fs.watchFile(). The note explains the expected behavior of previousStat in fs.watchFile() when a watched file disappears and reappears. Fixes: nodejs#15364
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a suggestion.
doc/api/fs.md
Outdated
|
||
In such cases the reappearance callback will not report the `previousStat` of | ||
the file with all zeroes. This is the correct and expected behavior for | ||
`uv_fs_poll_start()`, the libuv function that `fs.watchFile()` uses internally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This paragraph can be removed. The first sentence is redundant and the last sentence won't be relevant to most readers, they won't know or care it's implemented by libuv.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bnoordhuis Done!
Removed last paragraph, as per suggestions. The note explains the expected behavior of previousStat in fs.watchFile() when a watched file disappears and reappears. Fixes: nodejs#15364
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
Landed in 371d1db, thanks! |
Explains the expected behavior of previousStat in fs.watchFile() when a watched file disappears and reappears. PR-URL: #16099 Fixes: #15364 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Claudio Rodriguez <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Explains the expected behavior of previousStat in fs.watchFile() when a watched file disappears and reappears. PR-URL: nodejs/node#16099 Fixes: nodejs/node#15364 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Claudio Rodriguez <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Explains the expected behavior of previousStat in fs.watchFile() when a watched file disappears and reappears. PR-URL: #16099 Fixes: #15364 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Claudio Rodriguez <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Explains the expected behavior of previousStat in fs.watchFile() when a watched file disappears and reappears. PR-URL: #16099 Fixes: #15364 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Claudio Rodriguez <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Explains the expected behavior of previousStat in fs.watchFile() when a watched file disappears and reappears. PR-URL: #16099 Fixes: #15364 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Claudio Rodriguez <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Explains the expected behavior of previousStat in fs.watchFile() when a watched file disappears and reappears. PR-URL: #16099 Fixes: #15364 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Claudio Rodriguez <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Checklist:
make -j4 test
(UNIX) passesFixes: #15364