Class BaseFileSystem

Basic filesystem class. Most filesystems should extend this class, as it provides default implementations for a handful of methods.

Hierarchy

Constructors

Properties

_ready: Promise<BaseFileSystem> = ...
Name: string = ...

Accessors

Methods

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

    Parameters

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

    Returns Promise<void>

  • Create the file at path p with the given mode. Then, open it with the given flag.

    Parameters

    Returns Promise<File>

  • Create the file at path p with the given mode. Then, open it with the given flag.

    Parameters

    Returns File

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

  • Asynchronous link.

    Parameters

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

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

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

    Parameters

    • p: string

      The path to open.

    • flag: FileFlag

      The flag to use when opening the file.

    • cred: Cred

    Returns Promise<File>

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

    Parameters

    • p: string

      The path to open.

    • flag: FileFlag

      The flag to use when opening the file.

    • cred: Cred

    Returns File

    A File object corresponding to the opened file.

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

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

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

  • 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

  • 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