Class StoreFS<T>Internal

A file system which uses a Store

Check modes?

Type Parameters

Hierarchy (View Summary)

Constructors

Properties

_initialized: boolean = false
_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

label?: string
name: string

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

store: T

Methods

  • Add a inode/path pair

    Parameters

    • ino: number
    • path: string

    Returns void

  • Move paths in the tables

    Parameters

    • from: string
    • to: string

    Returns void

  • Gets the first path associated with an inode

    Parameters

    • id: number

    Returns undefined | string

  • Allocates a new ID and adds the ID/path

    Parameters

    • path: string
    • syscall: string

    Returns number

  • Checks if the root directory exists. Creates it if it doesn't.

    Returns Promise<void>

  • Commits a new file (well, a FILE or a DIRECTORY) to the file system with mode. Note: This will commit the transaction.

    Parameters

    • path: string

      The path to the new file.

    • options: PureCreationOptions

      The options to create the new file with.

    • data: Uint8Array

      The data to store at the file's data node.

    • syscall: string

    Returns Promise<Inode>

  • Commits a new file (well, a FILE or a DIRECTORY) to the file system with mode. Note: This will commit the transaction.

    Parameters

    • path: string

      The path to the new file.

    • options: PureCreationOptions

      The options to create the new file with.

    • data: Uint8Array

      The data to store at the file's data node.

    • syscall: string

    Returns Inode

    The Inode for the new file.

  • Finds the Inode of path.

    Parameters

    • tx: WrappedTransaction
    • path: string

      The path to look up.

    • syscall: string

    Returns Promise<Inode>

    memoize/cache

  • Finds the Inode of path.

    Parameters

    • tx: WrappedTransaction
    • path: string

      The path to look up.

    • syscall: string

    Returns Inode

    The Inode of the path p.

    memoize/cache

  • Load an index into the StoreFS. You must manually add non-directory files

    Parameters

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

  • Remove all traces of path from the file system.

    Parameters

    • path: string

      The path to remove from the file system.

    • isDir: boolean

      Does the path belong to a directory, or a file?

    Returns Promise<void>

    Update mtime.

  • Remove all traces of path from the file system.

    Parameters

    • path: string

      The path to remove from the file system.

    • isDir: boolean

      Does the path belong to a directory, or a file?

    Returns void

    Update mtime.

  • Parameters

    • oldPath: string
    • newPath: string

    Returns Promise<void>

    Make rename compatible with the cache.

  • Updated the inode and data node at path

    Parameters

    • path: string
    • Optionaldata: Uint8Array<ArrayBufferLike>
    • Optionalmetadata: Readonly<InodeLike>

    Returns Promise<void>

    Ensure mtime updates properly, and use that to determine if a data update is required.

  • Updated the inode and data node at path

    Parameters

    • path: string
    • Optionaldata: Uint8Array<ArrayBufferLike>
    • Optionalmetadata: Readonly<InodeLike>

    Returns void

    Ensure mtime updates properly, and use that to determine if a data update is required.

  • Writes a buffer to a file

    Parameters

    • path: string
    • data: Uint8Array
    • offset: number

      The offset in the file to start writing

    Returns Promise<void>

  • Writes a buffer to a file

    Parameters

    • path: string
    • data: Uint8Array
    • offset: number

      The offset in the file to start writing

    Returns void