FileHandle
[<Interface>]
type FileHandle =
abstract member fd: float
abstract member SymbolAsyncDispose () : Promise<unit>
abstract member appendFile (data: U15<string,AsyncIterable<BinaryLike,obj,obj>,BigInt64Array<U2<ArrayBuffer,SharedArrayBuffer>>,BigUint64Array<U2<ArrayBuffer,SharedArrayBuffer>>,DataView<U2<ArrayBuffer,SharedArrayBuffer>>,Float32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Float64Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int16Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int8Array<U2<ArrayBuffer,SharedArrayBuffer>>,Iterable<BinaryLike,obj,obj>,Uint16Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint8Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint8ClampedArray<U2<ArrayBuffer,SharedArrayBuffer>>>, ?options: U2<string,Options>) : Promise<unit>
abstract member chmod (mode: Mode) : Promise<unit>
abstract member chown (uid: float, gid: float) : Promise<unit>
abstract member close () : Promise<unit>
abstract member createReadStream (?options: CreateReadStreamOptions) : ReadStream
abstract member createWriteStream (?options: CreateWriteStreamOptions) : WriteStream
abstract member datasync () : Promise<unit>
abstract member read<'T> (?options: ReadOptionsWithBuffer<'T>) : Promise<FileReadResult<'T>>
abstract member read<'T> (buffer: 'T, ?options: ReadOptions) : Promise<FileReadResult<'T>>
abstract member read<'T> (buffer: 'T, ?offset: float, ?length: float, ?position: ReadPosition) : Promise<FileReadResult<'T>>
abstract member readFile (?options: U2<string,Options>) : Promise<U2<string,NonSharedBuffer>>
abstract member readFile (options: U2<string,Options2>) : Promise<string>
abstract member readFile (?options: Options) : Promise<NonSharedBuffer>
abstract member readLines (?options: CreateReadStreamOptions) : Interface
abstract member readableWebStream (?options: ReadableWebStreamOptions) : ReadableStream<obj>
abstract member readv<'TBuffers> (buffers: 'TBuffers, ?position: float) : Promise<ReadVResult<'TBuffers>>
abstract member stat (?opts: StatOptions) : Promise<U2<BigIntStats,Stats>>
abstract member stat (opts: Opts2) : Promise<BigIntStats>
abstract member stat (?opts: Opts) : Promise<Stats>
abstract member sync () : Promise<unit>
abstract member truncate (?len: float) : Promise<unit>
abstract member utimes (atime: TimeLike, mtime: TimeLike) : Promise<unit>
abstract member write (data: string, ?position: float, ?encoding: BufferEncoding) : Promise<Item3>
abstract member write<'TBuffer when 'TBuffer :> Uint8Array<U2<ArrayBuffer,SharedArrayBuffer>>> (buffer: 'TBuffer, ?options: Options) : Promise<Item2<'TBuffer>>
abstract member write<'TBuffer> (buffer: 'TBuffer, ?offset: float, ?length: float, ?position: float) : Promise<Item<'TBuffer>>
abstract member writeFile (data: U15<string,AsyncIterable<BinaryLike,obj,obj>,BigInt64Array<U2<ArrayBuffer,SharedArrayBuffer>>,BigUint64Array<U2<ArrayBuffer,SharedArrayBuffer>>,DataView<U2<ArrayBuffer,SharedArrayBuffer>>,Float32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Float64Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int16Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int8Array<U2<ArrayBuffer,SharedArrayBuffer>>,Iterable<BinaryLike,obj,obj>,Uint16Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint8Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint8ClampedArray<U2<ArrayBuffer,SharedArrayBuffer>>>, ?options: U2<string,Options>) : Promise<unit>
abstract member writev<'TBuffers> (buffers: 'TBuffers, ?position: float) : Promise<WriteVResult<'TBuffers>>| Assembly | Xantham.Fable.Node |
Declared inside
AppendFile | |
ReadFile | |
Stat | |
Write |
Properties
Methods
abstract member SymbolAsyncDispose () : Promise<unit>
abstract member SymbolAsyncDispose () : Promise<unit>Calls filehandle.close() and returns a promise that fulfills when the filehandle is closed.
@since v20.4.0
abstract member appendFile (data: U15<string,AsyncIterable<BinaryLike,obj,obj>,BigInt64Array<U2<ArrayBuffer,SharedArrayBuffer>>,BigUint64Array<U2<ArrayBuffer,SharedArrayBuffer>>,DataView<U2<ArrayBuffer,SharedArrayBuffer>>,Float32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Float64Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int16Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int8Array<U2<ArrayBuffer,SharedArrayBuffer>>,Iterable<BinaryLike,obj,obj>,Uint16Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint8Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint8ClampedArray<U2<ArrayBuffer,SharedArrayBuffer>>>, ?options: U2<string,Options>) : Promise<unit>
abstract member appendFile (data: U15<string,AsyncIterable<BinaryLike,obj,obj>,BigInt64Array<U2<ArrayBuffer,SharedArrayBuffer>>,BigUint64Array<U2<ArrayBuffer,SharedArrayBuffer>>,DataView<U2<ArrayBuffer,SharedArrayBuffer>>,Float32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Float64Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int16Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int8Array<U2<ArrayBuffer,SharedArrayBuffer>>,Iterable<BinaryLike,obj,obj>,Uint16Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint8Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint8ClampedArray<U2<ArrayBuffer,SharedArrayBuffer>>>, ?options: U2<string,Options>) : Promise<unit>Alias of filehandle.writeFile().
When operating on file handles, the mode cannot be changed from what it was set to with fsPromises.open(). Therefore, this is equivalent to filehandle.writeFile().
@since v10.0.0
Returns. Fulfills with undefined upon success.
abstract member chmod (mode: Mode) : Promise<unit>
abstract member chmod (mode: Mode) : Promise<unit>Modifies the permissions on the file. See chmod(2).
@since v10.0.0
| Parameter | |
|---|---|
mode | the file mode bit mask. |
Returns. Fulfills with undefined upon success.
abstract member chown (uid: float, gid: float) : Promise<unit>
abstract member chown (uid: float, gid: float) : Promise<unit>Changes the ownership of the file. A wrapper for chown(2).
@since v10.0.0
| Parameter | |
|---|---|
uid | The file's new owner's user id. |
gid | The file's new group's group id. |
Returns. Fulfills with undefined upon success.
abstract member close () : Promise<unit>
abstract member close () : Promise<unit>Closes the file handle after waiting for any pending operation on the handle to complete.
import { open } from 'node:fs/promises';
let filehandle;
try {
filehandle = await open('thefile.txt', 'r');
} finally {
await filehandle?.close();
}
@since v10.0.0
Returns. Fulfills with undefined upon success.
abstract member createReadStream (?options: CreateReadStreamOptions) : ReadStream
abstract member createReadStream (?options: CreateReadStreamOptions) : ReadStreamUnlike the 16 KiB default highWaterMark for a stream.Readable, the stream returned by this method has a default highWaterMark of 64 KiB.
options can include start and end values to read a range of bytes from the file instead of the entire file. Both start and end are inclusive and start counting at 0, allowed values are in the \0, [Number.MAX_SAFE_INTEGER] range. If start is omitted or undefined, filehandle.createReadStream() reads sequentially from the current file position. The encoding can be any one of those accepted by Buffer.
If the FileHandle points to a character device that only supports blocking reads (such as keyboard or sound card), read operations do not finish until data is available. This can prevent the process from exiting and the stream from closing naturally.
By default, the stream will emit a 'close' event after it has been destroyed. Set the emitClose option to false to change this behavior.
import { open } from 'node:fs/promises';
const fd = await open('/dev/input/event0');
// Create a stream from some character device.
const stream = fd.createReadStream();
setTimeout(() => {
stream.close(); // This may not close the stream.
// Artificially marking end-of-stream, as if the underlying resource had
// indicated end-of-file by itself, allows the stream to close.
// This does not cancel pending read operations, and if there is such an
// operation, the process may still not be able to exit successfully
// until it finishes.
stream.push(null);
stream.read(0);
}, 100);
If autoClose is false, then the file descriptor won't be closed, even if there's an error. It is the application's responsibility to close it and make sure there's no file descriptor leak. If autoClose is set to true (default behavior), on 'error' or 'end' the file descriptor will be closed automatically.
An example to read the last 10 bytes of a file which is 100 bytes long:
import { open } from 'node:fs/promises';
const fd = await open('sample.txt');
fd.createReadStream({ start: 90, end: 99 });
@since v16.11.0
abstract member createWriteStream (?options: CreateWriteStreamOptions) : WriteStream
abstract member createWriteStream (?options: CreateWriteStreamOptions) : WriteStreamoptions may also include a start option to allow writing data at some position past the beginning of the file, allowed values are in the \0, [Number.MAX_SAFE_INTEGER] range. Modifying a file rather than replacing it may require the flags``open option to be set to r+ rather than the default r. The encoding can be any one of those accepted by Buffer.
If autoClose is set to true (default behavior) on 'error' or 'finish' the file descriptor will be closed automatically. If autoClose is false, then the file descriptor won't be closed, even if there's an error. It is the application's responsibility to close it and make sure there's no file descriptor leak.
By default, the stream will emit a 'close' event after it has been destroyed. Set the emitClose option to false to change this behavior.
@since v16.11.0
abstract member datasync () : Promise<unit>
abstract member datasync () : Promise<unit>Forces all currently queued I/O operations associated with the file to the operating system's synchronized I/O completion state. Refer to the POSIX fdatasync(2) documentation for details.
Unlike filehandle.sync this method does not flush modified metadata.
@since v10.0.0
Returns. Fulfills with undefined upon success.
abstract member read<'T> (?options: ReadOptionsWithBuffer<'T>) : Promise<FileReadResult<'T>>
abstract member read<'T> (?options: ReadOptionsWithBuffer<'T>) : Promise<FileReadResult<'T>>Reads data from the file and stores that in the given buffer.
If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero.
@since v10.0.0
| Parameter | |
|---|---|
buffer | A buffer that will be filled with the file data read. |
offset | The location in the buffer at which to start filling. |
length | The number of bytes to read. |
position | The location where to begin reading data from the file. If null, data will be read from the current file position, and the position will be updated. If position is an integer, the current file position will remain unchanged. |
Returns. Fulfills upon success with an object with two properties:
abstract member read<'T> (buffer: 'T, ?options: ReadOptions) : Promise<FileReadResult<'T>>
abstract member read<'T> (buffer: 'T, ?options: ReadOptions) : Promise<FileReadResult<'T>>Reads data from the file and stores that in the given buffer.
If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero.
@since v10.0.0
| Parameter | |
|---|---|
buffer | A buffer that will be filled with the file data read. |
offset | The location in the buffer at which to start filling. |
length | The number of bytes to read. |
position | The location where to begin reading data from the file. If null, data will be read from the current file position, and the position will be updated. If position is an integer, the current file position will remain unchanged. |
Returns. Fulfills upon success with an object with two properties:
abstract member read<'T> (buffer: 'T, ?offset: float, ?length: float, ?position: ReadPosition) : Promise<FileReadResult<'T>>
abstract member read<'T> (buffer: 'T, ?offset: float, ?length: float, ?position: ReadPosition) : Promise<FileReadResult<'T>>Reads data from the file and stores that in the given buffer.
If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero.
@since v10.0.0
| Parameter | |
|---|---|
buffer | A buffer that will be filled with the file data read. |
offset | The location in the buffer at which to start filling. |
length | The number of bytes to read. |
position | The location where to begin reading data from the file. If null, data will be read from the current file position, and the position will be updated. If position is an integer, the current file position will remain unchanged. |
Returns. Fulfills upon success with an object with two properties:
abstract member readFile (?options: U2<string,Options>) : Promise<U2<string,NonSharedBuffer>>
abstract member readFile (?options: U2<string,Options>) : Promise<U2<string,NonSharedBuffer>>Asynchronously reads the entire contents of a file.
If options is a string, then it specifies the encoding.
The FileHandle has to support reading.
If one or more filehandle.read() calls are made on a file handle and then a filehandle.readFile() call is made, the data will be read from the current position till the end of the file. It doesn't always read from the beginning of the file. Asynchronously reads the entire contents of a file. The underlying file will not be closed automatically. The FileHandle must have been opened for reading.
abstract member readFile (options: U2<string,Options2>) : Promise<string>
abstract member readFile (options: U2<string,Options2>) : Promise<string>Asynchronously reads the entire contents of a file.
If options is a string, then it specifies the encoding.
The FileHandle has to support reading.
If one or more filehandle.read() calls are made on a file handle and then a filehandle.readFile() call is made, the data will be read from the current position till the end of the file. It doesn't always read from the beginning of the file. Asynchronously reads the entire contents of a file. The underlying file will not be closed automatically. The FileHandle must have been opened for reading.
abstract member readFile (?options: Options) : Promise<NonSharedBuffer>
abstract member readFile (?options: Options) : Promise<NonSharedBuffer>Asynchronously reads the entire contents of a file.
If options is a string, then it specifies the encoding.
The FileHandle has to support reading.
If one or more filehandle.read() calls are made on a file handle and then a filehandle.readFile() call is made, the data will be read from the current position till the end of the file. It doesn't always read from the beginning of the file. Asynchronously reads the entire contents of a file. The underlying file will not be closed automatically. The FileHandle must have been opened for reading.
@since v10.0.0
Returns. Fulfills upon a successful read with the contents of the file. If no encoding is specified (using options.encoding), the data is returned as a object. Otherwise, the data will be a string.
abstract member readLines (?options: CreateReadStreamOptions) : Interface
abstract member readLines (?options: CreateReadStreamOptions) : InterfaceConvenience method to create a readline interface and stream over the file. See filehandle.createReadStream() for the options.
import { open } from 'node:fs/promises';
const file = await open('./some/file/to/read');
for await (const line of file.readLines()) {
console.log(line);
}
@since v18.11.0
abstract member readableWebStream (?options: ReadableWebStreamOptions) : ReadableStream<obj>
abstract member readableWebStream (?options: ReadableWebStreamOptions) : ReadableStream<obj>Returns a byte-oriented ReadableStream that may be used to read the file's contents.
An error will be thrown if this method is called more than once or is called after the FileHandle is closed or closing.
import {
open,
} from 'node:fs/promises';
const file = await open('./some/file/to/read');
for await (const chunk of file.readableWebStream())
console.log(chunk);
await file.close();
While the ReadableStream will read the file to completion, it will not close the FileHandle automatically. User code must still call thefileHandle.close() method.
@since v17.0.0
abstract member readv<'TBuffers> (buffers: 'TBuffers, ?position: float) : Promise<ReadVResult<'TBuffers>>
abstract member readv<'TBuffers> (buffers: 'TBuffers, ?position: float) : Promise<ReadVResult<'TBuffers>>Read from a file and write to an array of ArrayBufferView s
@since v13.13.0, v12.17.0
| Parameter | |
|---|---|
position | The offset from the beginning of the file where the data should be read from. If position is not a number, the data will be read from the current position. |
Returns. Fulfills upon success an object containing two properties:
abstract member stat (?opts: StatOptions) : Promise<U2<BigIntStats,Stats>>
abstract member stat (?opts: StatOptions) : Promise<U2<BigIntStats,Stats>>@since v10.0.0
Returns. Fulfills with an for the file.
abstract member stat (opts: Opts2) : Promise<BigIntStats>
abstract member stat (opts: Opts2) : Promise<BigIntStats>@since v10.0.0
Returns. Fulfills with an for the file.
abstract member stat (?opts: Opts) : Promise<Stats>
abstract member stat (?opts: Opts) : Promise<Stats>@since v10.0.0
Returns. Fulfills with an for the file.
abstract member sync () : Promise<unit>
abstract member sync () : Promise<unit>Request that all data for the open file descriptor is flushed to the storage device. The specific implementation is operating system and device specific. Refer to the POSIX fsync(2) documentation for more detail.
@since v10.0.0
Returns. Fulfills with undefined upon success.
abstract member truncate (?len: float) : Promise<unit>
abstract member truncate (?len: float) : Promise<unit>Truncates the file.
If the file was larger than len bytes, only the first len bytes will be retained in the file.
The following example retains only the first four bytes of the file:
import { open } from 'node:fs/promises';
let filehandle = null;
try {
filehandle = await open('temp.txt', 'r+');
await filehandle.truncate(4);
} finally {
await filehandle?.close();
}
If the file previously was shorter than len bytes, it is extended, and the extended part is filled with null bytes ('\0'):
If len is negative then 0 will be used.
@since v10.0.0
Returns. Fulfills with undefined upon success.
abstract member utimes (atime: TimeLike, mtime: TimeLike) : Promise<unit>
abstract member utimes (atime: TimeLike, mtime: TimeLike) : Promise<unit>Change the file system timestamps of the object referenced by the FileHandle then fulfills the promise with no arguments upon success.
@since v10.0.0
abstract member write (data: string, ?position: float, ?encoding: BufferEncoding) : Promise<Item3>
abstract member write (data: string, ?position: float, ?encoding: BufferEncoding) : Promise<Item3>Write buffer to the file.
The promise is fulfilled with an object containing two properties:
It is unsafe to use filehandle.write() multiple times on the same file without waiting for the promise to be fulfilled (or rejected). For this scenario, use filehandle.createWriteStream().
On Linux, positional writes do not 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.
@since v10.0.0
| Parameter | |
|---|---|
offset | The start position from within buffer where the data to write begins. |
length | The number of bytes from buffer to write. |
position | The offset from the beginning of the file where the data from buffer should be written. If position is not a number, the data will be written at the current position. See the POSIX pwrite(2) documentation for more detail. |
abstract member write<'TBuffer when 'TBuffer :> Uint8Array<U2<ArrayBuffer,SharedArrayBuffer>>> (buffer: 'TBuffer, ?options: Options) : Promise<Item2<'TBuffer>>
abstract member write<'TBuffer when 'TBuffer :> Uint8Array<U2<ArrayBuffer,SharedArrayBuffer>>> (buffer: 'TBuffer, ?options: Options) : Promise<Item2<'TBuffer>>Write buffer to the file.
The promise is fulfilled with an object containing two properties:
It is unsafe to use filehandle.write() multiple times on the same file without waiting for the promise to be fulfilled (or rejected). For this scenario, use filehandle.createWriteStream().
On Linux, positional writes do not 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.
@since v10.0.0
| Parameter | |
|---|---|
offset | The start position from within buffer where the data to write begins. |
length | The number of bytes from buffer to write. |
position | The offset from the beginning of the file where the data from buffer should be written. If position is not a number, the data will be written at the current position. See the POSIX pwrite(2) documentation for more detail. |
abstract member write<'TBuffer> (buffer: 'TBuffer, ?offset: float, ?length: float, ?position: float) : Promise<Item<'TBuffer>>
abstract member write<'TBuffer> (buffer: 'TBuffer, ?offset: float, ?length: float, ?position: float) : Promise<Item<'TBuffer>>Write buffer to the file.
The promise is fulfilled with an object containing two properties:
It is unsafe to use filehandle.write() multiple times on the same file without waiting for the promise to be fulfilled (or rejected). For this scenario, use filehandle.createWriteStream().
On Linux, positional writes do not 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.
@since v10.0.0
| Parameter | |
|---|---|
offset | The start position from within buffer where the data to write begins. |
length | The number of bytes from buffer to write. |
position | The offset from the beginning of the file where the data from buffer should be written. If position is not a number, the data will be written at the current position. See the POSIX pwrite(2) documentation for more detail. |
abstract member writeFile (data: U15<string,AsyncIterable<BinaryLike,obj,obj>,BigInt64Array<U2<ArrayBuffer,SharedArrayBuffer>>,BigUint64Array<U2<ArrayBuffer,SharedArrayBuffer>>,DataView<U2<ArrayBuffer,SharedArrayBuffer>>,Float32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Float64Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int16Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int8Array<U2<ArrayBuffer,SharedArrayBuffer>>,Iterable<BinaryLike,obj,obj>,Uint16Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint8Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint8ClampedArray<U2<ArrayBuffer,SharedArrayBuffer>>>, ?options: U2<string,Options>) : Promise<unit>
abstract member writeFile (data: U15<string,AsyncIterable<BinaryLike,obj,obj>,BigInt64Array<U2<ArrayBuffer,SharedArrayBuffer>>,BigUint64Array<U2<ArrayBuffer,SharedArrayBuffer>>,DataView<U2<ArrayBuffer,SharedArrayBuffer>>,Float32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Float64Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int16Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Int8Array<U2<ArrayBuffer,SharedArrayBuffer>>,Iterable<BinaryLike,obj,obj>,Uint16Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint32Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint8Array<U2<ArrayBuffer,SharedArrayBuffer>>,Uint8ClampedArray<U2<ArrayBuffer,SharedArrayBuffer>>>, ?options: U2<string,Options>) : Promise<unit>Asynchronously writes data to a file, replacing the file if it already exists. data can be a string, a buffer, an AsyncIterable, or an Iterable object. The promise is fulfilled with no arguments upon success.
If options is a string, then it specifies the encoding.
The FileHandle has to support writing.
It is unsafe to use filehandle.writeFile() multiple times on the same file without waiting for the promise to be fulfilled (or rejected).
If one or more filehandle.write() calls are made on a file handle and then afilehandle.writeFile() call is made, the data will be written from the current position till the end of the file. It doesn't always write from the beginning of the file.
@since v10.0.0
abstract member writev<'TBuffers> (buffers: 'TBuffers, ?position: float) : Promise<WriteVResult<'TBuffers>>
abstract member writev<'TBuffers> (buffers: 'TBuffers, ?position: float) : Promise<WriteVResult<'TBuffers>>Write an array of ArrayBufferView s to the file.
The promise is fulfilled with an object containing a two properties:
It is unsafe to call writev() multiple times on the same file without waiting for the promise to be fulfilled (or rejected).
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.
@since v12.9.0
| Parameter | |
|---|---|
position | The offset from the beginning of the file where the data from buffers should be written. If position is not a number, the data will be written at the current position. |