Skip to content

Read

[<Interface>]
type Read =
    abstract member Invoke (fd: float, callback: Callback5) : unit
    abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, callback: Callback4<'TBuffer>) : unit
    abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, options: ReadOptions, callback: Callback3<'TBuffer>) : unit
    abstract member Invoke<'TBuffer> (fd: float, options: ReadOptionsWithBuffer<'TBuffer>, callback: Callback2<'TBuffer>) : unit
    abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, offset: float, length: float, position: ReadPosition option, callback: Callback<'TBuffer>) : unit
    abstract member __promisify__ (fd: float) : Promise<Item3>
    abstract member __promisify__<'TBuffer> (fd: float, options: ReadOptionsWithBuffer<'TBuffer>) : Promise<Item2<'TBuffer>>
    abstract member __promisify__<'TBuffer> (fd: float, buffer: 'TBuffer, offset: float, length: float, ?position: ReadPosition) : Promise<Item<'TBuffer>>
AssemblyXantham.Fable.Node

Declared inside

Callback
Callback2
Callback3
Callback4
Callback5
Promisify

Methods

abstract member Invoke (fd: float, callback: Callback5) : unit

Read data from the file specified by fd.

The callback is given the three arguments, (err, bytesRead, buffer).

If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesRead and buffer properties. Similar to the above fs.read function, this version takes an optional options object. If not otherwise specified in an options object, buffer defaults to Buffer.alloc(16384), offset defaults to 0, length defaults to buffer.byteLength, - offset as of Node 17.6.0 position defaults to null

@since v0.0.2

Parameter
bufferThe buffer that the data will be written to.
offsetThe position in buffer to write the data to.
lengthThe number of bytes to read.
positionSpecifies where to begin reading from in the file. If position is null or -1 , data will be read from the current file position, and the file position will be updated. If position is an integer, the file position will be unchanged.
abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, callback: Callback4<'TBuffer>) : unit

Read data from the file specified by fd.

The callback is given the three arguments, (err, bytesRead, buffer).

If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesRead and buffer properties. Similar to the above fs.read function, this version takes an optional options object. If not otherwise specified in an options object, buffer defaults to Buffer.alloc(16384), offset defaults to 0, length defaults to buffer.byteLength, - offset as of Node 17.6.0 position defaults to null

@since v0.0.2

Parameter
bufferThe buffer that the data will be written to.
offsetThe position in buffer to write the data to.
lengthThe number of bytes to read.
positionSpecifies where to begin reading from in the file. If position is null or -1 , data will be read from the current file position, and the file position will be updated. If position is an integer, the file position will be unchanged.
abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, options: ReadOptions, callback: Callback3<'TBuffer>) : unit

Read data from the file specified by fd.

The callback is given the three arguments, (err, bytesRead, buffer).

If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesRead and buffer properties. Similar to the above fs.read function, this version takes an optional options object. If not otherwise specified in an options object, buffer defaults to Buffer.alloc(16384), offset defaults to 0, length defaults to buffer.byteLength, - offset as of Node 17.6.0 position defaults to null

@since v0.0.2

Parameter
bufferThe buffer that the data will be written to.
offsetThe position in buffer to write the data to.
lengthThe number of bytes to read.
positionSpecifies where to begin reading from in the file. If position is null or -1 , data will be read from the current file position, and the file position will be updated. If position is an integer, the file position will be unchanged.
abstract member Invoke<'TBuffer> (fd: float, options: ReadOptionsWithBuffer<'TBuffer>, callback: Callback2<'TBuffer>) : unit

Read data from the file specified by fd.

The callback is given the three arguments, (err, bytesRead, buffer).

If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesRead and buffer properties. Similar to the above fs.read function, this version takes an optional options object. If not otherwise specified in an options object, buffer defaults to Buffer.alloc(16384), offset defaults to 0, length defaults to buffer.byteLength, - offset as of Node 17.6.0 position defaults to null

@since v0.0.2

abstract member Invoke<'TBuffer> (fd: float, buffer: 'TBuffer, offset: float, length: float, position: ReadPosition option, callback: Callback<'TBuffer>) : unit

Read data from the file specified by fd.

The callback is given the three arguments, (err, bytesRead, buffer).

If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesRead and buffer properties. Similar to the above fs.read function, this version takes an optional options object. If not otherwise specified in an options object, buffer defaults to Buffer.alloc(16384), offset defaults to 0, length defaults to buffer.byteLength, - offset as of Node 17.6.0 position defaults to null

@since v0.0.2

Parameter
bufferThe buffer that the data will be written to.
offsetThe position in buffer to write the data to.
lengthThe number of bytes to read.
positionSpecifies where to begin reading from in the file. If position is null or -1 , data will be read from the current file position, and the file position will be updated. If position is an integer, the file position will be unchanged.
abstract member __promisify__ (fd: float) : Promise<Item3>
Parameter
fdA file descriptor.
bufferThe buffer that the data will be written to.
offsetThe offset in the buffer at which to start writing.
lengthThe number of bytes to read.
positionThe offset from the beginning of the file from which data should be read. If null, data will be read from the current position.
abstract member __promisify__<'TBuffer> (fd: float, options: ReadOptionsWithBuffer<'TBuffer>) : Promise<Item2<'TBuffer>>
Parameter
fdA file descriptor.
bufferThe buffer that the data will be written to.
offsetThe offset in the buffer at which to start writing.
lengthThe number of bytes to read.
positionThe offset from the beginning of the file from which data should be read. If null, data will be read from the current position.
abstract member __promisify__<'TBuffer> (fd: float, buffer: 'TBuffer, offset: float, length: float, ?position: ReadPosition) : Promise<Item<'TBuffer>>
Parameter
fdA file descriptor.
bufferThe buffer that the data will be written to.
offsetThe offset in the buffer at which to start writing.
lengthThe number of bytes to read.
positionThe offset from the beginning of the file from which data should be read. If null, data will be read from the current position.