Class FileSystemAbstract Internal

Provides a consistent and easy to use internal API. Default implementations for exists and existsSync are included. If you are extending this class, note that every path is an absolute path and all arguments are present.

Hierarchy (View Summary)

Constructors

Properties

_disableSync?: boolean

Whether the sync cache should be disabled. Only affects async things.

Methods

  • Test whether or not path exists.

    Parameters

    • path: string

    Returns Promise<boolean>

  • Test whether or not path exists.

    Parameters

    • path: string

    Returns boolean

  • Parameters

    • target: string
    • link: string

    Returns Promise<void>

  • Parameters

    • target: string
    • link: string

    Returns void

  • Opens the file at path with flag. The file must exist.

    Parameters

    • path: string

      The path to open.

    • flag: string

      The flag to use when opening the file.

    Returns Promise<File<FileSystem>>

  • Opens the file at path with flag. The file must exist.

    Parameters

    • path: string

      The path to open.

    • flag: string

      The flag to use when opening the file.

    Returns File<FileSystem>

  • Reads into a buffer

    Parameters

    • path: string
    • buffer: Uint8Array<ArrayBufferLike>

      The buffer to read into. You must set the byteOffset and byteLength appropriately!

    • offset: number

      The offset into the file to start reading from

    • end: number

      The position in the file to stop reading

    Returns Promise<void>

  • Parameters

    • path: string

    Returns Promise<string[]>

  • Parameters

    • path: string

    Returns string[]

  • Reads into a buffer

    Parameters

    • path: string
    • buffer: Uint8Array<ArrayBufferLike>

      The buffer to read into. You must set the byteOffset and byteLength appropriately!

    • offset: number

      The offset into the file to start reading from

    • end: number

      The position in the file to stop reading

    Returns void

  • Parameters

    • oldPath: string
    • newPath: string

    Returns Promise<void>

  • Parameters

    • oldPath: string
    • newPath: string

    Returns void

  • Parameters

    • path: string

    Returns Promise<void>

  • Parameters

    • path: string
    • Optionaldata: Uint8Array<ArrayBufferLike>
    • Optionalstats: Readonly<Partial<StatsLike<number | bigint>>>

    Returns Promise<void>

  • Parameters

    • path: string
    • Optionaldata: Uint8Array<ArrayBufferLike>
    • Optionalstats: Readonly<Partial<StatsLike<number | bigint>>>

    Returns void

  • Parameters

    • path: string

    Returns Promise<void>

  • Writes a buffer to a file

    Parameters

    • path: string
    • buffer: Uint8Array<ArrayBufferLike>

      The buffer to write. You must set the byteOffset and byteLength appropriately!

    • offset: number

      The offset in the file to start writing

    Returns Promise<void>

  • Writes a buffer to a file

    Parameters

    • path: string
    • buffer: Uint8Array<ArrayBufferLike>

      The buffer to write. You must set the byteOffset and byteLength appropriately!

    • offset: number

      The offset in the file to start writing

    Returns void