From ebe4eb6f48b8afa7171150ebc4c29388cb2459bd Mon Sep 17 00:00:00 2001 From: topal Date: Wed, 23 Mar 2016 22:53:18 +0300 Subject: [PATCH] doc: updated fs #5862 removed irrelevant data in fs.markdown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fs.readFile, fs.writeFile and fs.appendFile doc changes pulled back from master included details not relevant to v4. PR-URL: https://github.com/nodejs/node/pull/5877 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell --- doc/api/fs.markdown | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown index 9d9d0672b6f488..fb2df9c0a9a890 100644 --- a/doc/api/fs.markdown +++ b/doc/api/fs.markdown @@ -252,7 +252,7 @@ fail, and does nothing otherwise. ## fs.appendFile(file, data[, options], callback) -* `file` {String|Number} filename or file descriptor +* `file` {String} filename * `data` {String|Buffer} * `options` {Object|String} * `encoding` {String|Null} default = `'utf8'` @@ -278,10 +278,6 @@ If `options` is a string, then it specifies the encoding. Example: fs.appendFile('message.txt', 'data to append', 'utf8', callback); ``` -Any specified file descriptor has to have been opened for appending. - -_Note: Specified file descriptors will not be closed automatically._ - ## fs.appendFileSync(file, data[, options]) The synchronous version of [`fs.appendFile()`][]. Returns `undefined`. @@ -620,7 +616,7 @@ Synchronous readdir(3). Returns an array of filenames excluding `'.'` and ## fs.readFile(file[, options], callback) -* `file` {String | Integer} filename or file descriptor +* `file` {String} filename * `options` {Object | String} * `encoding` {String | Null} default = `null` * `flag` {String} default = `'r'` @@ -646,10 +642,6 @@ If `options` is a string, then it specifies the encoding. Example: fs.readFile('/etc/passwd', 'utf8', callback); ``` -Any specified file descriptor has to support reading. - -_Note: Specified file descriptors will not be closed automatically._ - ## fs.readFileSync(file[, options]) Synchronous version of [`fs.readFile`][]. Returns the contents of the `file`. @@ -945,7 +937,7 @@ the end of the file. ## fs.writeFile(file, data[, options], callback) -* `file` {String | Integer} filename or file descriptor +* `file` {String} filename * `data` {String | Buffer} * `options` {Object | String} * `encoding` {String | Null} default = `'utf8'` @@ -974,14 +966,10 @@ If `options` is a string, then it specifies the encoding. Example: fs.writeFile('message.txt', 'Hello Node.js', 'utf8', callback); ``` -Any specified file descriptor has to support writing. - Note that it is unsafe to use `fs.writeFile` multiple times on the same file without waiting for the callback. For this scenario, `fs.createWriteStream` is strongly recommended. -_Note: Specified file descriptors will not be closed automatically._ - ## fs.writeFileSync(file, data[, options]) The synchronous version of [`fs.writeFile()`][]. Returns `undefined`.