method promises.FileHandle.write
FileHandle.write<TBuffer extends Uint8Array>(buffer: TBuffer,offset?: number | null,length?: number | null,position?: number | null,): Promise<{ bytesWritten: number; buffer: TBuffer; }>
Deprecated
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.
buffer: TBuffer
Promise<{ bytesWritten: number; buffer: TBuffer; }>