Class CopyOnWriteFSInternal

Using a readable file system as a base, writes are done to a writable file system.

Hierarchy (View Summary)

Constructors

Properties

_mountPoint?: string

The last place this file system was mounted

attributes: ConstMap<FileSystemAttributes, keyof FileSystemAttributes, void> & Map<
    string,
    any,
> = ...

FileSystemAttributes

id: number

A unique ID for this kind of file system. Currently unused internally, but could be used for partition tables or something

journal: Journal = ...

The journal to use for persisting deletions

label?: string
name: string

The name for this file system. For example, tmpfs for an in memory one

readable: FileSystem

The file system that initially populates this file system.

writable: FileSystem

The file system to write modified files to.

Methods

  • 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

  • Reads into a buffer

    Parameters

    • path: string
    • buffer: Uint8Array

      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>

  • Reads into a buffer

    Parameters

    • path: string
    • buffer: Uint8Array

      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

  • Writes a buffer to a file

    Parameters

    • path: string
    • buffer: Uint8Array

      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

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

    • offset: number

      The offset in the file to start writing

    Returns void