diff options
author | cjihrig <cjihrig@gmail.com> | 2019-08-17 14:56:13 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-08-19 15:34:25 -0400 |
commit | 3273d0e9514da750405cc2e3662d72dcbb489380 (patch) | |
tree | a4b120f260dfc643a99dbfc6fa78b20901cb4ddd /doc/api/fs.md | |
parent | 9f9a201cc67d09c7c61169f9e274a76afd4159fe (diff) | |
download | android-node-v8-3273d0e9514da750405cc2e3662d72dcbb489380.tar.gz android-node-v8-3273d0e9514da750405cc2e3662d72dcbb489380.tar.bz2 android-node-v8-3273d0e9514da750405cc2e3662d72dcbb489380.zip |
fs: add writev() promises version
https://github.com/nodejs/node/pull/25925 added fs.writev()
and fs.writevSync(), but did not include a Promises based
equivalent. This commit adds the missing method.
Refs: https://github.com/nodejs/node/pull/25925
PR-URL: https://github.com/nodejs/node/pull/29186
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/fs.md')
-rw-r--r-- | doc/api/fs.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md index d71f8afd82..58b17c3b21 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -4274,6 +4274,32 @@ If one or more `filehandle.write()` calls are made on a file handle and then a current position till the end of the file. It doesn't always write from the beginning of the file. +#### filehandle.writev(buffers[, position]) +<!-- YAML +added: REPLACEME +--> + +* `buffers` {ArrayBufferView[]} +* `position` {integer} +* Returns: {Promise} + +Write an array of `ArrayBufferView`s to the file. + +The `Promise` is resolved with an object containing a `bytesWritten` property +identifying the number of bytes written, and a `buffers` property containing +a reference to the `buffers` input. + +`position` is the offset from the beginning of the file where this data +should be written. If `typeof position !== 'number'`, the data will be written +at the current position. + +It is unsafe to call `writev()` multiple times on the same file without waiting +for the previous operation to complete. + +On Linux, positional writes don't work when the file is opened in append mode. +The kernel ignores the position argument and always appends the data to +the end of the file. + ### fsPromises.access(path[, mode]) <!-- YAML added: v10.0.0 |