ZenFS
    Preparing search index...

    Class HandleInternal

    Index
    • Creates a file handle for the vnode.

      Parameters

      • context: unknown
      • path: string
      • internalPath: string
      • flag: number
      • vnode: VNode

      Returns Handle

    _position: number = 0

    Current position

    closed: boolean = false

    Whether the file is open or closed

    context: unknown
    flag: number
    internalPath: string
    path: string
    vnode: VNode
    • get dirty(): boolean

      Whether the file has changes which have not been written to the FS

      Returns boolean

    • get position(): number

      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

      The current file position.

    • set position(value: number): void

      Parameters

      • value: number

      Returns void

    • Parameters

      • mode: number

      Returns Promise<void>

    • Parameters

      • mode: number

      Returns void

    • Parameters

      • uid: number
      • gid: number

      Returns Promise<void>

    • Parameters

      • uid: number
      • gid: number

      Returns void

    • Default implementation maps to sync.

      Returns Promise<void>

    • Default implementation maps to syncSync.

      Returns void

    • Cleans up. This will not sync the file data to the FS

      Parameters

      • Optionalforce: boolean

      Returns void

    • Cleans up. This will not sync the file data to the FS

      Parameters

      • Optionalforce: boolean

      Returns void

    • Read data from the file.

      Parameters

      • buffer: ArrayBufferView

        The buffer that the data will be written to.

      • offset: number = 0

        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<number>

      number of bytes written

    • Read data from the file.

      Parameters

      • buffer: ArrayBufferView

        The buffer that the data will be written to.

      • offset: number = 0

        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

      number of bytes written

    • Create a stream for reading the file.

      Parameters

      Returns ReadableStream

      Don't repeat ourselves with the implementation in FileSystem

    • Create a stream for writing the file. Chunks are written to the vnode's cache, then synced when the stream is closed.

      Parameters

      Returns WritableStream

      Don't repeat ourselves with the implementation in FileSystem

    • Parameters

      • length: number

      Returns Promise<void>

    • Parameters

      • length: number

      Returns void

    • Change the file timestamps of the file.

      Parameters

      • atime: number
      • mtime: number

      Returns Promise<void>

    • Change the file timestamps of the file.

      Parameters

      • atime: number
      • mtime: number

      Returns void

    • Write buffer to the file.

      Parameters

      • buffer: Uint8Array

        Uint8Array containing the data to write to the file.

      • offset: number = 0

        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>

      bytes written

    • Write buffer to the file.

      Parameters

      • buffer: Uint8Array

        Uint8Array containing the data to write to the file.

      • offset: number = 0

        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

      bytes written