FileSystem

interface FileSystem(source)

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.

Online Documentation

Types

Link copied to clipboard
interface CopyOptions
Link copied to clipboard
interface DeleteOptions
Link copied to clipboard
interface RenameOptions

Functions

Link copied to clipboard
abstract fun copy(source: Uri, target: Uri, options: FileSystem.CopyOptions = definedExternally): PromiseLike<Void>

Copy files or folders.

Link copied to clipboard
abstract fun createDirectory(uri: Uri): PromiseLike<Void>

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

Link copied to clipboard
abstract fun delete(uri: Uri, options: FileSystem.DeleteOptions = definedExternally): PromiseLike<Void>

Delete a file.

Link copied to clipboard
abstract fun isWritableFileSystem(scheme: String): Boolean?

Check if a given file system supports writing files.

Link copied to clipboard

Retrieve all entries of a directory.

Link copied to clipboard
abstract fun readFile(uri: Uri): PromiseLike<Uint8Array<*>>

Read the entire contents of a file.

Link copied to clipboard
abstract fun rename(source: Uri, target: Uri, options: FileSystem.RenameOptions = definedExternally): PromiseLike<Void>

Rename a file or folder.

Link copied to clipboard
abstract fun stat(uri: Uri): PromiseLike<FileStat>

Retrieve metadata about a file.

Link copied to clipboard
abstract fun writeFile(uri: Uri, content: Uint8Array<*>): PromiseLike<Void>

Write data to a file, replacing its entire contents.