summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJoran Dirk Greef <joran@ronomon.com>2016-04-07 14:36:39 +0200
committerJames M Snell <jasnell@gmail.com>2016-04-18 09:50:37 -0700
commit88c35e70a06d1d048cc32153d8214bcd28107528 (patch)
treed689d7710ccec0471bb83db9582b967c63a12a32 /doc
parentb95160daae00a5c39b3815c29a0cfcbc395e3824 (diff)
downloadandroid-node-v8-88c35e70a06d1d048cc32153d8214bcd28107528.tar.gz
android-node-v8-88c35e70a06d1d048cc32153d8214bcd28107528.tar.bz2
android-node-v8-88c35e70a06d1d048cc32153d8214bcd28107528.zip
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: https://github.com/nodejs/node/issues/5039 PR-URL: https://github.com/nodejs/node/pull/6099 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/fs.markdown11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown
index fc2dd5934e..8a05ffa3c2 100644
--- a/doc/api/fs.markdown
+++ b/doc/api/fs.markdown
@@ -1155,6 +1155,16 @@ reliably or at all.
You can still use `fs.watchFile`, which uses stat polling, but it is slower and
less reliable.
+#### Inodes
+
+<!--type=misc-->
+
+On Linux and OS X systems, `fs.watch()` resolves the path to an [inode][] and
+watches the inode. If the watched path is deleted and recreated, it is assigned
+a new inode. The watch will emit an event for the delete but will continue
+watching the *original* inode. Events for the new inode will not be emitted.
+This is expected behavior.
+
#### Filename Argument
<!--type=misc-->
@@ -1376,3 +1386,4 @@ Synchronous versions of [`fs.write()`][]. Returns the number of bytes written.
[MDN-Date]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date
[Readable Stream]: stream.html#stream_class_stream_readable
[Writable Stream]: stream.html#stream_class_stream_writable
+[inode]: http://www.linux.org/threads/intro-to-inodes.4130