@@ -4233,17 +4233,13 @@ added: v10.0.0
4233
4233
* ` data ` {string|Buffer}
4234
4234
* ` options ` {Object|string}
4235
4235
* ` encoding ` {string|null} ** Default:** ` 'utf8' `
4236
- * ` mode ` {integer} ** Default:** ` 0o666 `
4237
- * ` flag ` {string} See [ support of file system ` flags ` ] [ ] . ** Default:** ` 'a' ` .
4238
4236
* Returns: {Promise}
4239
4237
4240
- Asynchronously append data to this file, creating the file if it does not yet
4241
- exist. ` data ` can be a string or a [ ` Buffer ` ] [ ] . The ` Promise ` will be
4242
- resolved with no arguments upon success.
4238
+ Alias of [ ` filehandle.writeFile() ` ] [ ] .
4243
4239
4244
- If ` options ` is a string, then it specifies the encoding.
4245
-
4246
- The ` FileHandle ` must have been opened for appending .
4240
+ When operating on file handles, the mode cannot be changed from what it was set
4241
+ to with [ ` fsPromises.open() ` ] [ ] . Therefore, this is equivalent to
4242
+ [ ` filehandle.writeFile() ` ] [ ] .
4247
4243
4248
4244
#### ` filehandle.chmod(mode) `
4249
4245
<!-- YAML
@@ -4344,7 +4340,6 @@ added: v10.0.0
4344
4340
4345
4341
* ` options ` {Object|string}
4346
4342
* ` encoding ` {string|null} ** Default:** ` null `
4347
- * ` flag ` {string} See [ support of file system ` flags ` ] [ ] . ** Default:** ` 'r' ` .
4348
4343
* Returns: {Promise}
4349
4344
4350
4345
Asynchronously reads the entire contents of a file.
@@ -4355,11 +4350,6 @@ object. Otherwise, the data will be a string.
4355
4350
4356
4351
If ` options ` is a string, then it specifies the encoding.
4357
4352
4358
- When the ` path ` is a directory, the behavior of ` fsPromises.readFile() ` is
4359
- platform-specific. On macOS, Linux, and Windows, the promise will be rejected
4360
- with an error. On FreeBSD, a representation of the directory's contents will be
4361
- returned.
4362
-
4363
4353
The ` FileHandle ` has to support reading.
4364
4354
4365
4355
If one or more ` filehandle.read() ` calls are made on a file handle and then a
@@ -4549,8 +4539,6 @@ added: v10.0.0
4549
4539
* ` data ` {string|Buffer|Uint8Array}
4550
4540
* ` options ` {Object|string}
4551
4541
* ` encoding ` {string|null} ** Default:** ` 'utf8' `
4552
- * ` mode ` {integer} ** Default:** ` 0o666 `
4553
- * ` flag ` {string} See [ support of file system ` flags ` ] [ ] . ** Default:** ` 'w' ` .
4554
4542
* Returns: {Promise}
4555
4543
4556
4544
Asynchronously writes data to a file, replacing the file if it already exists.
@@ -5524,6 +5512,7 @@ the file contents.
5524
5512
[ `UV_THREADPOOL_SIZE` ] : cli.html#cli_uv_threadpool_size_size
5525
5513
[ `WriteStream` ] : #fs_class_fs_writestream
5526
5514
[ `event ports` ] : https://illumos.org/man/port_create
5515
+ [ `filehandle.writeFile()` ] : #fs_filehandle_writefile_data_options
5527
5516
[ `fs.Dir` ] : #fs_class_fs_dir
5528
5517
[ `fs.Dirent` ] : #fs_class_fs_dirent
5529
5518
[ `fs.FSWatcher` ] : #fs_class_fs_fswatcher
@@ -5558,6 +5547,7 @@ the file contents.
5558
5547
[ `fs.write(fd, string...)` ] : #fs_fs_write_fd_string_position_encoding_callback
5559
5548
[ `fs.writeFile()` ] : #fs_fs_writefile_file_data_options_callback
5560
5549
[ `fs.writev()` ] : #fs_fs_writev_fd_buffers_position_callback
5550
+ [ `fsPromises.open()` ] : #fs_fspromises_open_path_flags_mode
5561
5551
[ `fsPromises.opendir()` ] : #fs_fspromises_opendir_path_options
5562
5552
[ `inotify(7)` ] : http://man7.org/linux/man-pages/man7/inotify.7.html
5563
5553
[ `kqueue(2)` ] : https://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
0 commit comments