Skip to content

Commit

Permalink
doc: updated fs
Browse files Browse the repository at this point in the history
nodejs#5862
removed irrelevant data about fs.writeFile and fs.appendFile
  • Loading branch information
ToPal committed Mar 24, 2016
1 parent 0ee2c02 commit 53dfad2
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions doc/api/fs.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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'`
Expand All @@ -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`.
Expand Down Expand Up @@ -941,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'`
Expand Down Expand Up @@ -970,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`.
Expand Down

0 comments on commit 53dfad2

Please sign in to comment.