Class UnmutexedOverlayFSInternal

OverlayFS makes a read-only filesystem writable by storing writes on a second, writable file system. Deletes are persisted via metadata stored on the writable file system.

This class contains no locking whatsoever. It is mutexed to prevent races.

Hierarchy (view full)

Constructors

Properties

_deleteLog: string = ''
_deleteLogError?: ErrnoError
_deleteLogUpdateNeeded: boolean = false
_deleteLogUpdatePending: boolean = false
_deletedFiles: Set<string> = ...
_disableSync?: boolean

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

_isInitialized: boolean = false
_ready: Promise<void>
readable: FileSystem
writable: FileSystem

Methods

  • Internal

    Called once to load up metadata stored on the writable file system.

    Returns Promise<void>

  • Copy from readable to writable storage. PRECONDITION: File does not exist on writable storage.

    Parameters

    • path: string

    Returns void

  • With the given path, create the needed parent directories on the writable storage should they not exist. Use modes from the read-only storage.

    Parameters

    • path: string

    Returns void

  • Opens the file at path with the given 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>

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

    Parameters

    • path: string

      The path to open.

    • flag: string

      The flag to use when opening the file.

    Returns File

    A File object corresponding to the opened file.

  • Helper function:

    • Ensures p is on writable before proceeding. Throws an error if it doesn't exist.
    • Calls f to perform operation on writable.

    Parameters

    • path: string

    Returns void

  • Synchronize the data and stats for path asynchronously

    Parameters

    • path: string
    • data: Uint8Array
    • stats: Readonly<Stats>

    Returns Promise<void>