Interface File

Hierarchy

  • File

Implemented by

Methods

  • Optional: Asynchronous fchmod.

    Parameters

    • mode: number

    Returns Promise<void>

  • Optional: Synchronous fchmod.

    Parameters

    • mode: number

    Returns void

  • Optional: Asynchronous chown.

    Parameters

    • uid: number
    • gid: number

    Returns Promise<void>

  • Optional: Synchronous chown.

    Parameters

    • uid: number
    • gid: number

    Returns void

  • Core: Asynchronous close.

    Returns Promise<void>

  • Core: Synchronous close.

    Returns void

  • Supplementary: Asynchronous datasync.

    Default implementation maps to sync.

    Returns Promise<void>

  • Supplementary: Synchronous datasync.

    Default implementation maps to syncSync.

    Returns void

  • Core: Get the current file position.

    Returns number

  • Core: Read data from the file.

    Parameters

    • buffer: Uint8Array

      The buffer that the data will be written to.

    • offset: number

      The offset within the buffer where writing will start.

    • length: number

      An integer specifying the number of bytes to read.

    • position: number

      An integer specifying where to begin reading from in the file. If position is null, data will be read from the current file position.

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

    Promise resolving to the new length of the buffer

  • Core: Read data from the file.

    Parameters

    • buffer: Uint8Array

      The buffer that the data will be written to.

    • offset: number

      The offset within the buffer where writing will start.

    • length: number

      An integer specifying the number of bytes to read.

    • position: number

      An integer specifying where to begin reading from in the file. If position is null, data will be read from the current file position.

    Returns number

  • Core: Asynchronous sync.

    Returns Promise<void>

  • Core: Synchronous sync.

    Returns void

  • Core: Asynchronous truncate.

    Parameters

    • len: number

    Returns Promise<void>

  • Core: Synchronous truncate.

    Parameters

    • len: number

    Returns void

  • Optional: Change the file timestamps of the file.

    Parameters

    • atime: Date
    • mtime: Date

    Returns Promise<void>

  • Optional: Change the file timestamps of the file.

    Parameters

    • atime: Date
    • mtime: Date

    Returns void

  • Core: Write buffer to the file. Note that it is unsafe to use fs.write multiple times on the same file without waiting for the callback.

    Parameters

    • buffer: Uint8Array

      Uint8Array containing the data to write to the file.

    • offset: number

      Offset in the buffer to start reading data from.

    • length: number

      The amount of bytes to write to the file.

    • position: number

      Offset from the beginning of the file where this data should be written. If position is null, the data will be written at the current position.

    Returns Promise<number>

    Promise resolving to the new length of the buffer

  • Core: Write buffer to the file. Note that it is unsafe to use fs.writeSync multiple times on the same file without waiting for it to return.

    Parameters

    • buffer: Uint8Array

      Uint8Array containing the data to write to the file.

    • offset: number

      Offset in the buffer to start reading data from.

    • length: number

      The amount of bytes to write to the file.

    • position: number

      Offset from the beginning of the file where this data should be written. If position is null, the data will be written at the current position.

    Returns number

Generated using TypeDoc