Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bb97de0

Browse filesBrowse files
jorangreefMylesBorins
authored andcommitted
doc: clarify fs.watch() and inodes on linux, os x
On Linux and OS X systems, `fs.watch()` resolves the watched path to an inode. This clarifies that `fs.watch()` watches the inode and not the path. If the inode of the path subsequently changes, `fs.watch()` will continue watching the original inode and events for the path will no longer be emitted. This is expected behavior. Fixes: #5039 PR-URL: #6099 Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 01d4522 commit bb97de0
Copy full SHA for bb97de0

File tree

Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/fs.markdown‎

Copy file name to clipboardExpand all lines: doc/api/fs.markdown
+11Lines changed: 11 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,16 @@ reliably or at all.
869869
You can still use `fs.watchFile`, which uses stat polling, but it is slower and
870870
less reliable.
871871

872+
#### Inodes
873+
874+
<!--type=misc-->
875+
876+
On Linux and OS X systems, `fs.watch()` resolves the path to an [inode][] and
877+
watches the inode. If the watched path is deleted and recreated, it is assigned
878+
a new inode. The watch will emit an event for the delete but will continue
879+
watching the *original* inode. Events for the new inode will not be emitted.
880+
This is expected behavior.
881+
872882
#### Filename Argument
873883

874884
<!--type=misc-->
@@ -1053,3 +1063,4 @@ Synchronous versions of [`fs.write()`][]. Returns the number of bytes written.
10531063
[MDN-Date]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date
10541064
[Readable Stream]: stream.html#stream_class_stream_readable
10551065
[Writable Stream]: stream.html#stream_class_stream_writable
1066+
[inode]: http://www.linux.org/threads/intro-to-inodes.4130

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.