Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FileSystemProviderWithAccessCapability

Subtype of FileSystemProvider that ensures that the optional functions needed for providers, that should be able access files, are implemented.

Hierarchy

Index

Properties

The FileSystemProviderCapabilities for this provider.

onDidChangeCapabilities: Event<void>

Event that is fired if the capabilities of this provider have changed.

onDidChangeFile: Event<readonly FileChange[]>

Event that is fired if a (watched) file in the filesystem of this provider has changed.

onFileWatchError: Event<void>

Event that is fired if an error occurred when watching files in the filesystem of this provider.

Methods

  • access(resource: URI, mode?: number): Promise<void>
  • Tests a user's permissions for the file or directory specified by URI.

    Parameters

    • resource: URI

      The URI of the file that should be tested.

    • Optional mode: number

      An optional integer that specifies the accessibility checks to be performed. Check FileAccess.Constants for possible values of mode. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. FileAccess.Constants.W_OK | FileAccess.Constants.R_OK). If mode is not defined, FileAccess.Constants.F_OK will be used instead.

    Returns Promise<void>

    A promise that resolves if the user has the required permissions, should be rejected otherwise.

  • close(fd: number): Promise<void>
  • Delete the given resource.

    Parameters

    • resource: URI

      The URI of the resource to delete.

    • opts: FileDeleteOptions

      Options to define if files should be deleted recursively and if the trash should be used.

    Returns Promise<void>

  • fsPath(resource: URI): Promise<string>
  • Returns the path of the given file URI, specific to the backend's operating system. If the URI is not a file URI, undefined is returned.

    USE WITH CAUTION: You should always prefer URIs to paths if possible, as they are portable and platform independent. Paths should only be used in cases you directly interact with the OS, e.g. when running a command on the shell.

    Parameters

    • resource: URI

      URI of the resource to derive the path from.

    Returns Promise<string>

    A promise of the corresponding file system path.

  • mkdir(resource: URI): Promise<void>
  • Create a new directory using the given resource uri.

    Parameters

    • resource: URI

      The URI of the new folder.

    Returns Promise<void>

  • read(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number>
  • readFile(resource: URI): Promise<Uint8Array>
  • readFileStream(resource: URI, opts: FileReadStreamOptions, token: CancellationToken): ReadableStreamEvents<Uint8Array>
  • readdir(resource: URI): Promise<[string, FileType][]>
  • Retrieve the content of a given directory.

    Parameters

    • resource: URI

      The URI of the directory.

    Returns Promise<[string, FileType][]>

    A map containing the FileType for each child resource, identified by name.

  • Rename a file or folder.

    Parameters

    • from: URI

      URI of the existing file or folder.

    • to: URI

      URI of the target location.

    • opts: FileOverwriteOptions

      Options to define if existing files should be overwritten.

    Returns Promise<void>

  • stat(resource: URI): Promise<Stat>
  • Watch the given resource and react to changes by firing the {@link FileSystemProvider#onDidChangeFile} event.

    Parameters

    • resource: URI

      URI of the resource to be watched.

    • opts: WatchOptions

      Options to define if the resource should be watched recursively and to provide a set of resources that should be excluded from watching.

    Returns Disposable

    A Disposable that can be invoked to stop watching the resource.

  • write(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number>
  • writeFile(resource: URI, content: Uint8Array, opts: FileWriteOptions): Promise<void>