Skip to content

Write

[<Interface>]
type Write =
    abstract member Invoke (fd: float, string: string, callback: Callback8) : unit
    abstract member Invoke (fd: float, string: string, position: float option, callback: Callback7) : unit
    abstract member Invoke (fd: float, string: string, position: float option, encoding: BufferEncoding option, callback: Callback6) : unit
    abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, options: WriteOptions, callback: Callback5<'TBuffer>) : unit
    abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, callback: Callback4<'TBuffer>) : unit
    abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, offset: float option, callback: Callback3<'TBuffer>) : unit
    abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, offset: float option, length: float option, callback: Callback2<'TBuffer>) : unit
    abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, offset: float option, length: float option, position: float option, callback: Callback<'TBuffer>) : unit
    abstract member __promisify__ (fd: float, string: string, ?position: float, ?encoding: BufferEncoding) : Promise<Item3>
    abstract member __promisify__<'TBuffer> (fd: float, ?buffer: 'TBuffer, ?options: WriteOptions) : Promise<Item2<'TBuffer>>
    abstract member __promisify__<'TBuffer> (fd: float, ?buffer: 'TBuffer, ?offset: float, ?length: float, ?position: float) : Promise<Item<'TBuffer>>
AssemblyXantham.Fable.Node

Declared inside

Callback
Callback2
Callback3
Callback4
Callback5
Callback6
Callback7
Callback8
Promisify

Methods

abstract member Invoke (fd: float, string: string, callback: Callback8) : unit

Write buffer to the file specified by fd.

offset determines the part of the buffer to be written, and length is an integer specifying the number of bytes to write.

position refers to 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. See pwrite(2).

The callback will be given three arguments (err, bytesWritten, buffer) where bytesWritten specifies how many bytes were written from buffer.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesWritten and buffer properties.

It is unsafe to use fs.write() multiple times on the same file without waiting for the callback. For this scenario, createWriteStream is recommended.

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. Asynchronously writes buffer to the file referenced by the supplied file descriptor. Asynchronously writes string to the file referenced by the supplied file descriptor.

Parameter
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
lengthThe number of bytes to write. If not supplied, defaults to buffer.length - offset.
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
fdA file descriptor.
fdA file descriptor.
optionsAn object with the following properties: * offset The part of the buffer to be written. If not supplied, defaults to 0. * length The number of bytes to write. If not supplied, defaults to buffer.length - offset. * position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
encodingThe expected string encoding.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
abstract member Invoke (fd: float, string: string, position: float option, callback: Callback7) : unit

Write buffer to the file specified by fd.

offset determines the part of the buffer to be written, and length is an integer specifying the number of bytes to write.

position refers to 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. See pwrite(2).

The callback will be given three arguments (err, bytesWritten, buffer) where bytesWritten specifies how many bytes were written from buffer.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesWritten and buffer properties.

It is unsafe to use fs.write() multiple times on the same file without waiting for the callback. For this scenario, createWriteStream is recommended.

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. Asynchronously writes buffer to the file referenced by the supplied file descriptor. Asynchronously writes string to the file referenced by the supplied file descriptor.

Parameter
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
lengthThe number of bytes to write. If not supplied, defaults to buffer.length - offset.
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
fdA file descriptor.
fdA file descriptor.
optionsAn object with the following properties: * offset The part of the buffer to be written. If not supplied, defaults to 0. * length The number of bytes to write. If not supplied, defaults to buffer.length - offset. * position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
encodingThe expected string encoding.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
abstract member Invoke (fd: float, string: string, position: float option, encoding: BufferEncoding option, callback: Callback6) : unit

Write buffer to the file specified by fd.

offset determines the part of the buffer to be written, and length is an integer specifying the number of bytes to write.

position refers to 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. See pwrite(2).

The callback will be given three arguments (err, bytesWritten, buffer) where bytesWritten specifies how many bytes were written from buffer.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesWritten and buffer properties.

It is unsafe to use fs.write() multiple times on the same file without waiting for the callback. For this scenario, createWriteStream is recommended.

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. Asynchronously writes buffer to the file referenced by the supplied file descriptor. Asynchronously writes string to the file referenced by the supplied file descriptor.

Parameter
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
lengthThe number of bytes to write. If not supplied, defaults to buffer.length - offset.
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
fdA file descriptor.
fdA file descriptor.
optionsAn object with the following properties: * offset The part of the buffer to be written. If not supplied, defaults to 0. * length The number of bytes to write. If not supplied, defaults to buffer.length - offset. * position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
encodingThe expected string encoding.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, options: WriteOptions, callback: Callback5<'TBuffer>) : unit

Write buffer to the file specified by fd.

offset determines the part of the buffer to be written, and length is an integer specifying the number of bytes to write.

position refers to 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. See pwrite(2).

The callback will be given three arguments (err, bytesWritten, buffer) where bytesWritten specifies how many bytes were written from buffer.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesWritten and buffer properties.

It is unsafe to use fs.write() multiple times on the same file without waiting for the callback. For this scenario, createWriteStream is recommended.

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. Asynchronously writes buffer to the file referenced by the supplied file descriptor. Asynchronously writes string to the file referenced by the supplied file descriptor.

Parameter
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
lengthThe number of bytes to write. If not supplied, defaults to buffer.length - offset.
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
fdA file descriptor.
fdA file descriptor.
optionsAn object with the following properties: * offset The part of the buffer to be written. If not supplied, defaults to 0. * length The number of bytes to write. If not supplied, defaults to buffer.length - offset. * position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
encodingThe expected string encoding.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, callback: Callback4<'TBuffer>) : unit

Write buffer to the file specified by fd.

offset determines the part of the buffer to be written, and length is an integer specifying the number of bytes to write.

position refers to 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. See pwrite(2).

The callback will be given three arguments (err, bytesWritten, buffer) where bytesWritten specifies how many bytes were written from buffer.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesWritten and buffer properties.

It is unsafe to use fs.write() multiple times on the same file without waiting for the callback. For this scenario, createWriteStream is recommended.

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. Asynchronously writes buffer to the file referenced by the supplied file descriptor. Asynchronously writes string to the file referenced by the supplied file descriptor.

Parameter
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
lengthThe number of bytes to write. If not supplied, defaults to buffer.length - offset.
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
fdA file descriptor.
fdA file descriptor.
optionsAn object with the following properties: * offset The part of the buffer to be written. If not supplied, defaults to 0. * length The number of bytes to write. If not supplied, defaults to buffer.length - offset. * position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
encodingThe expected string encoding.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, offset: float option, callback: Callback3<'TBuffer>) : unit

Write buffer to the file specified by fd.

offset determines the part of the buffer to be written, and length is an integer specifying the number of bytes to write.

position refers to 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. See pwrite(2).

The callback will be given three arguments (err, bytesWritten, buffer) where bytesWritten specifies how many bytes were written from buffer.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesWritten and buffer properties.

It is unsafe to use fs.write() multiple times on the same file without waiting for the callback. For this scenario, createWriteStream is recommended.

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. Asynchronously writes buffer to the file referenced by the supplied file descriptor. Asynchronously writes string to the file referenced by the supplied file descriptor.

Parameter
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
lengthThe number of bytes to write. If not supplied, defaults to buffer.length - offset.
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
fdA file descriptor.
fdA file descriptor.
optionsAn object with the following properties: * offset The part of the buffer to be written. If not supplied, defaults to 0. * length The number of bytes to write. If not supplied, defaults to buffer.length - offset. * position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
encodingThe expected string encoding.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, offset: float option, length: float option, callback: Callback2<'TBuffer>) : unit

Write buffer to the file specified by fd.

offset determines the part of the buffer to be written, and length is an integer specifying the number of bytes to write.

position refers to 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. See pwrite(2).

The callback will be given three arguments (err, bytesWritten, buffer) where bytesWritten specifies how many bytes were written from buffer.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesWritten and buffer properties.

It is unsafe to use fs.write() multiple times on the same file without waiting for the callback. For this scenario, createWriteStream is recommended.

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. Asynchronously writes buffer to the file referenced by the supplied file descriptor. Asynchronously writes string to the file referenced by the supplied file descriptor.

Parameter
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
lengthThe number of bytes to write. If not supplied, defaults to buffer.length - offset.
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
fdA file descriptor.
fdA file descriptor.
optionsAn object with the following properties: * offset The part of the buffer to be written. If not supplied, defaults to 0. * length The number of bytes to write. If not supplied, defaults to buffer.length - offset. * position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
encodingThe expected string encoding.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, offset: float option, length: float option, position: float option, callback: Callback<'TBuffer>) : unit

Write buffer to the file specified by fd.

offset determines the part of the buffer to be written, and length is an integer specifying the number of bytes to write.

position refers to 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. See pwrite(2).

The callback will be given three arguments (err, bytesWritten, buffer) where bytesWritten specifies how many bytes were written from buffer.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesWritten and buffer properties.

It is unsafe to use fs.write() multiple times on the same file without waiting for the callback. For this scenario, createWriteStream is recommended.

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. Asynchronously writes buffer to the file referenced by the supplied file descriptor. Asynchronously writes string to the file referenced by the supplied file descriptor.

@since v0.0.2

Parameter
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
lengthThe number of bytes to write. If not supplied, defaults to buffer.length - offset.
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
fdA file descriptor.
fdA file descriptor.
optionsAn object with the following properties: * offset The part of the buffer to be written. If not supplied, defaults to 0. * length The number of bytes to write. If not supplied, defaults to buffer.length - offset. * position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
encodingThe expected string encoding.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
abstract member __promisify__ (fd: float, string: string, ?position: float, ?encoding: BufferEncoding) : Promise<Item3>

Asynchronously writes buffer to the file referenced by the supplied file descriptor. Asynchronously writes string to the file referenced by the supplied file descriptor.

Parameter
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
lengthThe number of bytes to write. If not supplied, defaults to buffer.length - offset.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
optionsAn object with the following properties: * offset The part of the buffer to be written. If not supplied, defaults to 0. * length The number of bytes to write. If not supplied, defaults to buffer.length - offset. * position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
encodingThe expected string encoding.
abstract member __promisify__<'TBuffer> (fd: float, ?buffer: 'TBuffer, ?options: WriteOptions) : Promise<Item2<'TBuffer>>

Asynchronously writes buffer to the file referenced by the supplied file descriptor. Asynchronously writes string to the file referenced by the supplied file descriptor.

Parameter
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
lengthThe number of bytes to write. If not supplied, defaults to buffer.length - offset.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
optionsAn object with the following properties: * offset The part of the buffer to be written. If not supplied, defaults to 0. * length The number of bytes to write. If not supplied, defaults to buffer.length - offset. * position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
encodingThe expected string encoding.
abstract member __promisify__<'TBuffer> (fd: float, ?buffer: 'TBuffer, ?offset: float, ?length: float, ?position: float) : Promise<Item<'TBuffer>>

Asynchronously writes buffer to the file referenced by the supplied file descriptor. Asynchronously writes string to the file referenced by the supplied file descriptor.

Parameter
fdA file descriptor.
offsetThe part of the buffer to be written. If not supplied, defaults to 0.
lengthThe number of bytes to write. If not supplied, defaults to buffer.length - offset.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
optionsAn object with the following properties: * offset The part of the buffer to be written. If not supplied, defaults to 0. * length The number of bytes to write. If not supplied, defaults to buffer.length - offset. * position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
fdA file descriptor.
stringA string to write.
positionThe offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
encodingThe expected string encoding.