Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FileSystem

The file system interface exposes the editor's built-in and contributed file system providers. It allows extensions to work with files from the local disk as well as files from remote places, like the remote extension host or ftp-servers.

Note that an instance of this interface is available as workspace.fs.

Hierarchy

  • FileSystem

Index

Methods

  • copy(source: Uri, target: Uri, options?: { overwrite?: boolean }): Thenable<void>
  • Copy files or folders.

    Parameters

    • source: Uri

      The existing file.

    • target: Uri
    • Optional options: { overwrite?: boolean }

      Defines if existing files should be overwritten.

      • Optional overwrite?: boolean

    Returns Thenable<void>

  • Create a new directory (Note, that new files are created via write-calls).

    Note that missing directories are created automatically, e.g this call has mkdirp semantics.

    Parameters

    • uri: Uri

      The uri of the new folder.

    Returns Thenable<void>

  • delete(uri: Uri, options?: { recursive?: boolean; useTrash?: boolean }): Thenable<void>
  • Delete a file.

    Parameters

    • uri: Uri

      The resource that is to be deleted.

    • Optional options: { recursive?: boolean; useTrash?: boolean }

      Defines if trash can should be used and if deletion of folders is recursive

      • Optional recursive?: boolean
      • Optional useTrash?: boolean

    Returns Thenable<void>

  • rename(source: Uri, target: Uri, options?: { overwrite?: boolean }): Thenable<void>
  • Rename a file or folder.

    Parameters

    • source: Uri
    • target: Uri
    • Optional options: { overwrite?: boolean }

      Defines if existing files should be overwritten.

      • Optional overwrite?: boolean

    Returns Thenable<void>

  • writeFile(uri: Uri, content: Uint8Array): Thenable<void>