Interface FileHandle

Hierarchy

  • FileHandle

Properties

path: string

The file path.

readable: ReadableStream<Uint8Array>
writable: WritableStream<Uint8Array>

Methods

  • Closes the file.

    Returns Promise<void>

  • Returns Promise<void>

  • Reads data into the given buffer at the given file offset. Returns the amount of read data or null for EOF.

    Parameters

    • buffer: Uint8Array

      Buffer to read data into.

    • Optional offset: number

      Offset in the file to read from.

    Returns Promise<number>

  • Returns Promise<void>

  • Truncates the file to the given length.

    Parameters

    • Optional offset: number

      Length to truncate the file to.

    Returns Promise<void>

  • Writes data from the given buffer at the given file offset. Returns the amount of data written.

    Parameters

    • buffer: Uint8Array

      Buffer to write.

    • Optional offset: number

      Offset in the file to write to.

    Returns Promise<number>

Generated using TypeDoc