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 30f354f

Browse filesBrowse files
jorangreefMyles Borins
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 d1fca27 commit 30f354f
Copy full SHA for 30f354f

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
@@ -830,6 +830,16 @@ reliably or at all.
830830
You can still use `fs.watchFile`, which uses stat polling, but it is slower and
831831
less reliable.
832832

833+
#### Inodes
834+
835+
<!--type=misc-->
836+
837+
On Linux and OS X systems, `fs.watch()` resolves the path to an [inode][] and
838+
watches the inode. If the watched path is deleted and recreated, it is assigned
839+
a new inode. The watch will emit an event for the delete but will continue
840+
watching the *original* inode. Events for the new inode will not be emitted.
841+
This is expected behavior.
842+
833843
#### Filename Argument
834844

835845
<!--type=misc-->
@@ -1010,3 +1020,4 @@ Synchronous versions of [`fs.write()`][]. Returns the number of bytes written.
10101020
[MDN-Date]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date
10111021
[Readable Stream]: stream.html#stream_class_stream_readable
10121022
[Writable Stream]: stream.html#stream_class_stream_writable
1023+
[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.