Class SynchronousFileSystem

Implements the asynchronous API in terms of the synchronous API.

Hierarchy

Constructors

Properties

_ready: Promise<SynchronousFileSystem> = ...
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>

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