A contents manager that passes file operations to the server. Multiple servers implementing the IDrive interface can be attached to the contents manager, so that the same session can perform file operations on multiple backends.

This includes checkpointing with the normal file operations.

Implements

Constructors

Properties

serverSettings: ServerConnection.ISettings

The server settings associated with the manager.

Accessors

Methods

  • Given a path of the form drive:local/portion/of/it.txt get the name of the drive. If the path is missing a drive portion, returns an empty string.

    Parameters

    • path: string

      the path.

    Returns string

    The drive name for the path, or the empty string.

  • Normalize a global path. Reduces '..' and '.' parts, and removes leading slashes from the local part of the path, while retaining the drive name if it exists.

    Parameters

    • path: string

      the path.

    Returns string

    The normalized path.

  • Resolve a global path, starting from the root path. Behaves like posix-path.resolve, with 3 differences:

    • will never prepend cwd
    • if root has a drive name, the result is prefixed with ":"
    • before adding drive name, leading slashes are removed

    Parameters

    • root: string
    • path: string

      the path.

    Returns string

    The normalized path.