## 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'`
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`.
## 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'`
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`.
## 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'`
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`.