modal
    Preparing search index...

    Class SandboxFilesystem

    Namespace for Sandbox filesystem APIs.

    Index

    Methods

    • Copy a local file into the Sandbox.

      remotePath must be an absolute path to a file in the Sandbox. Parent directories are created if needed. The remote file is overwritten if it already exists.

      Parameters

      • localPath: string
      • remotePath: string

      Returns Promise<void>

      a parent component of remotePath is not a directory.

      remotePath points to a directory.

      write permission is denied in the Sandbox.

      the command fails for any other reason.

      localPath does not exist, is a directory, or cannot be read (ENOENT, EISDIR, EACCES).

    • Copy a file from the Sandbox to a local path.

      remotePath must be an absolute path to a file in the Sandbox. Parent directories for localPath are created if needed. The local file is overwritten if it already exists.

      Parameters

      • remotePath: string
      • localPath: string

      Returns Promise<void>

      the remote path does not exist.

      the remote path points to a directory.

      the file exceeds the read size limit.

      read permission is denied in the Sandbox.

      the command fails for any other reason.

      localPath points to a directory, or writing it is not permitted.

    • List files and directories in a Sandbox directory.

      remotePath must be an absolute path to a directory in the Sandbox. Returns an array of FileInfo objects sorted by name.

      Parameters

      • remotePath: string

      Returns Promise<FileInfo[]>

      the path does not exist.

      the path is not a directory.

      read permission is denied.

      the command fails for any other reason.

    • Create a new directory in the Sandbox.

      remotePath must be an absolute path in the Sandbox.

      When createParents is true (the default), any missing parent directories are created and the call is idempotent (succeeds if the directory already exists). When createParents is false, the immediate parent must already exist and the path must not already exist.

      Parameters

      • remotePath: string
      • Optionaloptions: { createParents?: boolean }

      Returns Promise<void>

      the parent does not exist and createParents is false.

      the path already exists and createParents is false.

      a path component is not a directory.

      creation is not permitted.

      the operation is not supported by the mount.

      the command fails for any other reason.

    • Read a file from the Sandbox and return its contents as bytes.

      remotePath must be an absolute path to a file in the Sandbox.

      Parameters

      • remotePath: string

      Returns Promise<Uint8Array<ArrayBufferLike>>

      the path does not exist.

      the path points to a directory.

      the file exceeds the read size limit.

      read permission is denied.

      the command fails for any other reason.

    • Read a file from the Sandbox and return its contents as a UTF-8 string.

      remotePath must be an absolute path to a file in the Sandbox.

      Parameters

      • remotePath: string

      Returns Promise<string>

      the path does not exist.

      the path points to a directory.

      the file exceeds the read size limit.

      read permission is denied.

      the command fails for any other reason.

    • Remove a file or directory in the Sandbox.

      remotePath must be an absolute path in the Sandbox. When remotePath is a directory and recursive is false (the default), it is removed only if empty. When recursive is true, the directory and all its contents are removed. Recursive removal is not supported on all mounts — CloudBucketMount does not support it.

      Parameters

      • remotePath: string
      • Optionaloptions: { recursive?: boolean }

      Returns Promise<void>

      the path does not exist.

      recursive is false and the directory is not empty.

      removal is not permitted.

      the operation is not supported by the mount.

      the command fails for any other reason.

    • Return metadata for a single file, directory, or symlink in the Sandbox.

      remotePath must be an absolute path in the Sandbox. If remotePath is a symlink, the returned FileInfo describes the symlink itself, not the target it points to.

      Parameters

      • remotePath: string

      Returns Promise<FileInfo>

      the path does not exist.

      a non-leaf component of the path is not a directory.

      a path component is not searchable.

      the command fails for any other reason.

    • Write binary content to a file in the Sandbox.

      remotePath must be an absolute path to a file in the Sandbox. Parent directories are created if needed. The remote file is overwritten if it already exists.

      Parameters

      • data: ArrayBuffer | Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>
      • remotePath: string

      Returns Promise<void>

      data is not a Uint8Array, ArrayBuffer, or Buffer.

      a parent component of remotePath is not a directory.

      remotePath points to a directory.

      write permission is denied.

      the command fails for any other reason.

    • Write UTF-8 text to a file in the Sandbox.

      remotePath must be an absolute path to a file in the Sandbox. Parent directories are created if needed. The remote file is overwritten if it already exists.

      Parameters

      • data: string
      • remotePath: string

      Returns Promise<void>

      data is not a string.

      a parent component of remotePath is not a directory.

      remotePath points to a directory.

      write permission is denied.

      the command fails for any other reason.