Skip to content

Commit b70ca4a

Browse files
ToPalMyles Borins
authored and
Myles Borins
committed
doc: updated fs #5862 removed irrelevant data in fs.markdown
fs.readFile, fs.writeFile and fs.appendFile doc changes pulled back from master included details not relevant to v4. PR-URL: #5877 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent ab5ad06 commit b70ca4a

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

doc/api/fs.markdown

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ fail, and does nothing otherwise.
252252

253253
## fs.appendFile(file, data[, options], callback)
254254

255-
* `file` {String|Number} filename or file descriptor
255+
* `file` {String} filename
256256
* `data` {String|Buffer}
257257
* `options` {Object|String}
258258
* `encoding` {String|Null} default = `'utf8'`
@@ -278,10 +278,6 @@ If `options` is a string, then it specifies the encoding. Example:
278278
fs.appendFile('message.txt', 'data to append', 'utf8', callback);
279279
```
280280

281-
Any specified file descriptor has to have been opened for appending.
282-
283-
_Note: Specified file descriptors will not be closed automatically._
284-
285281
## fs.appendFileSync(file, data[, options])
286282

287283
The synchronous version of [`fs.appendFile()`][]. Returns `undefined`.
@@ -620,7 +616,7 @@ Synchronous readdir(3). Returns an array of filenames excluding `'.'` and
620616

621617
## fs.readFile(file[, options], callback)
622618

623-
* `file` {String | Integer} filename or file descriptor
619+
* `file` {String} filename
624620
* `options` {Object | String}
625621
* `encoding` {String | Null} default = `null`
626622
* `flag` {String} default = `'r'`
@@ -646,10 +642,6 @@ If `options` is a string, then it specifies the encoding. Example:
646642
fs.readFile('/etc/passwd', 'utf8', callback);
647643
```
648644

649-
Any specified file descriptor has to support reading.
650-
651-
_Note: Specified file descriptors will not be closed automatically._
652-
653645
## fs.readFileSync(file[, options])
654646

655647
Synchronous version of [`fs.readFile`][]. Returns the contents of the `file`.
@@ -945,7 +937,7 @@ the end of the file.
945937

946938
## fs.writeFile(file, data[, options], callback)
947939

948-
* `file` {String | Integer} filename or file descriptor
940+
* `file` {String} filename
949941
* `data` {String | Buffer}
950942
* `options` {Object | String}
951943
* `encoding` {String | Null} default = `'utf8'`
@@ -974,14 +966,10 @@ If `options` is a string, then it specifies the encoding. Example:
974966
fs.writeFile('message.txt', 'Hello Node.js', 'utf8', callback);
975967
```
976968

977-
Any specified file descriptor has to support writing.
978-
979969
Note that it is unsafe to use `fs.writeFile` multiple times on the same file
980970
without waiting for the callback. For this scenario,
981971
`fs.createWriteStream` is strongly recommended.
982972

983-
_Note: Specified file descriptors will not be closed automatically._
984-
985973
## fs.writeFileSync(file, data[, options])
986974

987975
The synchronous version of [`fs.writeFile()`][]. Returns `undefined`.

0 commit comments

Comments
 (0)