ZenFS
    Preparing search index...

    Class StoreFS<T>Internal

    A file system which uses a Store

    Check modes?

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _initialized: boolean = false
    _mountPoint?: string

    The last place this file system was mounted

    _uuid: `${string}-${string}-${string}-${string}-${string}` = ...

    The UUID of the file system.

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

    FileSystemAttributes

    label?: string
    name: string

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

    store: T
    type: number

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

    Accessors

    • get uuid(): `${string}-${string}-${string}-${string}-${string}`

      Returns `${string}-${string}-${string}-${string}-${string}`

    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

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

        The options to create the new file with.

      • data: Uint8Array

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

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

        The options to create the new file with.

      • data: Uint8Array

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

      Returns Inode

      The Inode for the new file.

    • Finds the Inode of path.

      Parameters

      • tx: WrappedTransaction
      • path: string

        The path to look up.

      Returns Promise<Inode>

      memoize/cache

    • Finds the Inode of path.

      Parameters

      • tx: WrappedTransaction
      • path: string

        The path to look up.

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

    • 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

    • Parameters

      • oldPath: string
      • newPath: string

      Returns Promise<void>

      Make rename compatible with the cache.

    • 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