@@ -4253,17 +4253,13 @@ added: v10.0.0
4253
4253
* ` data ` {string|Buffer}
4254
4254
* ` options ` {Object|string}
4255
4255
* ` encoding ` {string|null} ** Default:** ` 'utf8' `
4256
- * ` mode ` {integer} ** Default:** ` 0o666 `
4257
- * ` flag ` {string} See [ support of file system ` flags ` ] [ ] . ** Default:** ` 'a' ` .
4258
4256
* Returns: {Promise}
4259
4257
4260
- Asynchronously append data to this file, creating the file if it does not yet
4261
- exist. ` data ` can be a string or a [ ` Buffer ` ] [ ] . The ` Promise ` will be
4262
- resolved with no arguments upon success.
4258
+ Alias of [ ` filehandle.writeFile() ` ] [ ] .
4263
4259
4264
- If ` options ` is a string, then it specifies the encoding.
4265
-
4266
- The ` FileHandle ` must have been opened for appending .
4260
+ When operating on file handles, the mode cannot be changed from what it was set
4261
+ to with [ ` fsPromises.open() ` ] [ ] . Therefore, this is equivalent to
4262
+ [ ` filehandle.writeFile() ` ] [ ] .
4267
4263
4268
4264
#### ` filehandle.chmod(mode) `
4269
4265
<!-- YAML
@@ -4364,7 +4360,6 @@ added: v10.0.0
4364
4360
4365
4361
* ` options ` {Object|string}
4366
4362
* ` encoding ` {string|null} ** Default:** ` null `
4367
- * ` flag ` {string} See [ support of file system ` flags ` ] [ ] . ** Default:** ` 'r' ` .
4368
4363
* Returns: {Promise}
4369
4364
4370
4365
Asynchronously reads the entire contents of a file.
@@ -4375,11 +4370,6 @@ object. Otherwise, the data will be a string.
4375
4370
4376
4371
If ` options ` is a string, then it specifies the encoding.
4377
4372
4378
- When the ` path ` is a directory, the behavior of ` fsPromises.readFile() ` is
4379
- platform-specific. On macOS, Linux, and Windows, the promise will be rejected
4380
- with an error. On FreeBSD, a representation of the directory's contents will be
4381
- returned.
4382
-
4383
4373
The ` FileHandle ` has to support reading.
4384
4374
4385
4375
If one or more ` filehandle.read() ` calls are made on a file handle and then a
@@ -4569,8 +4559,6 @@ added: v10.0.0
4569
4559
* ` data ` {string|Buffer|Uint8Array}
4570
4560
* ` options ` {Object|string}
4571
4561
* ` encoding ` {string|null} ** Default:** ` 'utf8' `
4572
- * ` mode ` {integer} ** Default:** ` 0o666 `
4573
- * ` flag ` {string} See [ support of file system ` flags ` ] [ ] . ** Default:** ` 'w' ` .
4574
4562
* Returns: {Promise}
4575
4563
4576
4564
Asynchronously writes data to a file, replacing the file if it already exists.
@@ -5545,6 +5533,7 @@ the file contents.
5545
5533
[ `UV_THREADPOOL_SIZE` ] : cli.html#cli_uv_threadpool_size_size
5546
5534
[ `WriteStream` ] : #fs_class_fs_writestream
5547
5535
[ `event ports` ] : https://illumos.org/man/port_create
5536
+ [ `filehandle.writeFile()` ] : #fs_filehandle_writefile_data_options
5548
5537
[ `fs.Dir` ] : #fs_class_fs_dir
5549
5538
[ `fs.Dirent` ] : #fs_class_fs_dirent
5550
5539
[ `fs.FSWatcher` ] : #fs_class_fs_fswatcher
@@ -5579,6 +5568,7 @@ the file contents.
5579
5568
[ `fs.write(fd, string...)` ] : #fs_fs_write_fd_string_position_encoding_callback
5580
5569
[ `fs.writeFile()` ] : #fs_fs_writefile_file_data_options_callback
5581
5570
[ `fs.writev()` ] : #fs_fs_writev_fd_buffers_position_callback
5571
+ [ `fsPromises.open()` ] : #fs_fspromises_open_path_flags_mode
5582
5572
[ `fsPromises.opendir()` ] : #fs_fspromises_opendir_path_options
5583
5573
[ `inotify(7)` ] : http://man7.org/linux/man-pages/man7/inotify.7.html
5584
5574
[ `kqueue(2)` ] : https://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
0 commit comments