From 18b94ea838f834209c311005ac9cd3cc6d205bca Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 17 May 2012 06:18:25 +0200 Subject: [PATCH] doc: improve fs.open() docs --- doc/api/fs.markdown | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown index 79a989e..afae449 100644 --- a/doc/api/fs.markdown +++ b/doc/api/fs.markdown @@ -270,16 +270,18 @@ An exception occurs if the file does not exist. * `'r+'` - Open file for reading and writing. An exception occurs if the file does not exist. -* `'rs'` - Open file for reading, telling the OS to open it synchronously -(ie using the O_SYNC flag). Whilst rarely useful, when used with caution by -those who know what they're doing it can be sometimes necessary. Note that -this doesn't turn `fs.open()` into a synchronous blocking call, if that's what -you want then you should be using `fs.openSync()` -An exception occurs if the file does not exist. +* `'rs'` - Open file for reading in synchronous mode. Instructs the operating + system to bypass the local file system cache. + + This is primarily useful for opening files on NFS mounts as it allows you to + skip the potentially stale local cache. It has a very real impact on I/O + performance so don't use this mode unless you need it. + + Note that this doesn't turn `fs.open()` into a synchronous blocking call. + If that's what you want then you should be using `fs.openSync()` * `'rs+'` - Open file for reading and writing, telling the OS to open it -synchronously. -See notes for `'rs'` about using this with caution. + synchronously. See notes for `'rs'` about using this with caution. * `'w'` - Open file for writing. The file is created (if it does not exist) or truncated (if it exists). -- 2.7.4