Class FileSystemAbstract

Structure for a filesystem. All BrowserFS FileSystems must implement this.

Argument Assumptions

You can assume the following about arguments passed to each API method:

  • Every path is an absolute path. ., .., and other items are resolved into an absolute form.
  • All arguments are present. Any optional arguments at the Node API level have been passed in with their default values.

Hierarchy

Constructors

Properties

Name: string

Methods

  • Asynchronous access.

    Parameters

    • p: string
    • mode: number
    • cred: Cred

    Returns Promise<void>

  • Synchronous access.

    Parameters

    • p: string
    • mode: number
    • cred: Cred

    Returns void

  • Asynchronously append data to a file, creating the file if it not yet exists.

    Parameters

    • fname: string
    • data: Uint8Array
    • flag: FileFlag
    • mode: number
    • cred: Cred

    Returns Promise<void>

  • Synchronously append data to a file, creating the file if it not yet exists.

    Parameters

    • fname: string
    • data: Uint8Array
    • flag: FileFlag
    • mode: number
    • cred: Cred

    Returns void

  • Asynchronous chmod.

    Parameters

    • p: string
    • mode: number
    • cred: Cred

    Returns Promise<void>

  • Synchronous chmod.

    Parameters

    • p: string
    • mode: number
    • cred: Cred

    Returns void

  • Asynchronous chown.

    Parameters

    • p: string
    • new_uid: number
    • new_gid: number
    • cred: Cred

    Returns Promise<void>

  • Synchronous chown.

    Parameters

    • p: string
    • new_uid: number
    • new_gid: number
    • cred: Cred

    Returns void

  • Test whether or not the given path exists by checking with the file system. Then call the callback argument with either true or false.

    Parameters

    • p: string
    • cred: Cred

    Returns Promise<boolean>

  • Test whether or not the given path exists by checking with the file system.

    Parameters

    • p: string
    • cred: Cred

    Returns boolean

  • Asynchronous link.

    Parameters

    • srcpath: string
    • dstpath: string
    • cred: Cred

    Returns Promise<void>

  • Synchronous link.

    Parameters

    • srcpath: string
    • dstpath: string
    • cred: Cred

    Returns void

  • Asynchronous mkdir.

    Parameters

    • p: string
    • mode: number

      Mode to make the directory using. Can be ignored if the filesystem doesn't support permissions.

    • cred: Cred

    Returns Promise<void>

  • Synchronous mkdir.

    Parameters

    • p: string
    • mode: number

      Mode to make the directory using. Can be ignored if the filesystem doesn't support permissions.

    • cred: Cred

    Returns void

  • Asynchronously reads the entire contents of a file.

    Parameters

    Returns Promise<Uint8Array>

  • Synchronously reads the entire contents of a file.

    Parameters

    Returns Uint8Array

  • Asynchronous readdir. Reads the contents of a directory.

    The callback gets two arguments (err, files) where files is an array of the names of the files in the directory excluding '.' and '..'.

    Parameters

    • p: string
    • cred: Cred

    Returns Promise<string[]>

  • Synchronous readdir. Reads the contents of a directory.

    Parameters

    • p: string
    • cred: Cred

    Returns string[]

  • Asynchronous readlink.

    Parameters

    • p: string
    • cred: Cred

    Returns Promise<string>

  • Synchronous readlink.

    Parameters

    • p: string
    • cred: Cred

    Returns string

  • Asynchronous realpath. The callback gets two arguments (err, resolvedPath).

    Note that the Node API will resolve path to an absolute path.

    Parameters

    • p: string
    • cred: Cred

    Returns Promise<string>

  • Synchronous realpath.

    Note that the Node API will resolve path to an absolute path.

    Parameters

    • p: string
    • cred: Cred

    Returns string

  • Asynchronous rename. No arguments other than a possible exception are given to the completion callback.

    Parameters

    • oldPath: string
    • newPath: string
    • cred: Cred

    Returns Promise<void>

  • Synchronous rename.

    Parameters

    • oldPath: string
    • newPath: string
    • cred: Cred

    Returns void

  • Asynchronous rmdir.

    Parameters

    • p: string
    • cred: Cred

    Returns Promise<void>

  • Asynchronous symlink.

    Parameters

    • srcpath: string
    • dstpath: string
    • type: string

      can be either 'dir' or 'file'

    • cred: Cred

    Returns Promise<void>

  • Synchronous symlink.

    Parameters

    • srcpath: string
    • dstpath: string
    • type: string

      can be either 'dir' or 'file'

    • cred: Cred

    Returns void

  • Asynchronous truncate.

    Parameters

    • p: string
    • len: number
    • cred: Cred

    Returns Promise<void>

  • Synchronous truncate.

    Parameters

    • p: string
    • len: number
    • cred: Cred

    Returns void

  • Asynchronous unlink.

    Parameters

    • p: string
    • cred: Cred

    Returns Promise<void>

  • Change file timestamps of the file referenced by the supplied path.

    Parameters

    • p: string
    • atime: Date
    • mtime: Date
    • cred: Cred

    Returns Promise<void>

  • Change file timestamps of the file referenced by the supplied path.

    Parameters

    • p: string
    • atime: Date
    • mtime: Date
    • cred: Cred

    Returns void

  • Asynchronously writes data to a file, replacing the file if it already exists.

    The encoding option is ignored if data is a buffer.

    Parameters

    • fname: string
    • data: Uint8Array
    • flag: FileFlag
    • mode: number
    • cred: Cred

    Returns Promise<void>

  • Synchronously writes data to a file, replacing the file if it already exists.

    The encoding option is ignored if data is a buffer.

    Parameters

    • fname: string
    • data: Uint8Array
    • flag: FileFlag
    • mode: number
    • cred: Cred

    Returns void

Generated using TypeDoc