Skip to main content

writeSync

function writeSync
Jump to headingwriteSync(
fd: number,
buffer: ArrayBufferView,
offset?: number | null,
length?: number | null,
position?: number | null,
): number

For detailed information, see the documentation of the asynchronous version of this API: write.

Parameters Jump to heading

Jump to headingbuffer: ArrayBufferView
optional
Jump to headingoffset: number | null = 0
optional
Jump to headinglength: number | null = buffer.byteLength - offset
optional
Jump to headingposition: number | null = 'null'

Return Type Jump to heading

number

The number of bytes written.

Jump to headingwriteSync(
fd: number,
string: string,
position?: number | null,
encoding?: BufferEncoding | null,
): number

Synchronously writes string to the file referenced by the supplied file descriptor, returning the number of bytes written.

Parameters Jump to heading

A file descriptor.

Jump to headingstring: string

A string to write.

optional
Jump to headingposition: number | null

The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.

optional
Jump to headingencoding: BufferEncoding | null

The expected string encoding.

Return Type Jump to heading

number
Back to top