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

    Type Parameters

    Parameters

    • fd: number

      A file descriptor.

    • Optional buffer: TBuffer
    • Optional offset: number

      The part of the buffer to be written. If not supplied, defaults to 0.

    • Optional length: number

      The number of bytes to write. If not supplied, defaults to buffer.length - offset.

    • Optional position: null | number

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

    Returns Promise<{
        buffer: TBuffer;
        bytesWritten: number;
    }>

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

    Parameters

    • fd: number

      A file descriptor.

    • string: string

      A string to write.

    • Optional position: null | number

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

    • Optional encoding: null | BufferEncoding

      The expected string encoding.

    Returns Promise<{
        buffer: string;
        bytesWritten: number;
    }>