Class FileSystemAccessFile

Hierarchy

Constructors

Properties

_buffer: Uint8Array
_dirty: boolean
_flag: FileFlag
_path: string
_pos: number
_stat: Stats

Methods

  • Advance the current file position by the indicated number of positions.

    Parameters

    • delta: number

    Returns number

  • Asynchronous fchmod.

    Parameters

    • mode: number

    Returns Promise<void>

  • Synchronous fchmod.

    Parameters

    • mode: number

    Returns void

  • Asynchronous fchown.

    Parameters

    • uid: number
    • gid: number

    Returns Promise<void>

  • Synchronous fchown.

    Parameters

    • uid: number
    • gid: number

    Returns void

  • Core: Synchronous close.

    Returns void

  • Returns Promise<void>

  • Returns void

  • NONSTANDARD: Get the underlying buffer for this file. !!DO NOT MUTATE!! Will mess up dirty tracking.

    Returns Uint8Array

  • Returns FileFlag

  • Get the path to this file.

    Returns string

    [String] The path to the file.

  • Get the current file position.

    We emulate the following bug mentioned in the Node documentation:

    On Linux, positional writes don't work when the file is opened in append mode. The kernel ignores the position argument and always appends the data to the end of the file.

    Returns number

    [Number] The current file position.

  • NONSTANDARD: Get underlying stats for this file. !!DO NOT MUTATE!!

    Returns Stats

  • Returns boolean

  • Read data from the file.

    Parameters

    • buffer: Uint8Array
    • offset: number
    • length: number
    • position: number

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

  • Read data from the file.

    Parameters

    • buffer: Uint8Array
    • offset: number
    • length: number
    • position: number

    Returns number

    [Number]

  • Resets the dirty bit. Should only be called after a sync has completed successfully.

    Returns void

  • Set the file position.

    Parameters

    • newPos: number

    Returns number

  • Asynchronous stat.

    Returns Promise<Stats>

  • Synchronous stat.

    Returns Stats

  • Core: Synchronous sync.

    Returns void

  • Asynchronous truncate.

    Parameters

    • len: number

    Returns Promise<void>

  • Synchronous truncate.

    Parameters

    • len: number

    Returns void

  • Parameters

    • atime: Date
    • mtime: Date

    Returns Promise<void>

  • Parameters

    • atime: Date
    • mtime: Date

    Returns void

  • 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
    • offset: number
    • length: number
    • position: number

    Returns Promise<number>

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

    Parameters

    • buffer: Uint8Array
    • offset: number
    • length: number
    • position: number

    Returns number

    [Number]

Generated using TypeDoc