Function read

  • 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.

    Type Parameters

    Parameters

    • fd: number
    • buffer: TBuffer

      The buffer that the data will be written to.

    • offset: number

      The position in buffer to write the data to.

    • length: number

      The number of bytes to read.

    • position: null | ReadPosition

      Specifies 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.

    • callback: ((err, bytesRead, buffer) => void)
        • (err, bytesRead, buffer): void
        • Parameters

          Returns void

    Returns void

    Since

    v0.0.2

    See

  • 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.

    Type Parameters

    Parameters

    Returns void

    Since

    v0.0.2

    See

  • 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.

    Parameters

    • fd: number
    • callback: ((err, bytesRead, buffer) => void)

    Returns void

    Since

    v0.0.2

    See

  • 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.

    Type Parameters

    Parameters

    • fd: number
    • buffer: TBuffer

      The buffer that the data will be written to.

    • offset: number

      The position in buffer to write the data to.

    • length: number

      The number of bytes to read.

    • position: null | number

      Specifies 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.

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

    Since

    v0.0.2

    See

  • 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.

    Type Parameters

    Parameters

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

    Since

    v0.0.2

    See

  • 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.

    Parameters

    • fd: number

    Returns Promise<{
        buffer: ArrayBufferView;
        bytesRead: number;
    }>

    Since

    v0.0.2

    See

Methods

  • Type Parameters

    Parameters

    • fd: number

      A file descriptor.

    • buffer: TBuffer

      The buffer that the data will be written to.

    • offset: number

      The offset in the buffer at which to start writing.

    • length: number

      The number of bytes to read.

    • position: null | number

      The offset from the beginning of the file from which data should be read. If null, data will be read from the current position.

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

  • Type Parameters

    Parameters

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

  • Parameters

    • fd: number

    Returns Promise<{
        buffer: ArrayBufferView;
        bytesRead: number;
    }>

Generated using TypeDoc