Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FileSystemProviderWithOpenReadWriteCloseCapability

Subtype of FileSystemProvider that ensures that the optional functions, needed for providers that should be able to open,read, write or close files, are implemented.

Hierarchy

Implemented by

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>
  • 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>
  • 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>

  • Open the give file.

    Parameters

    • resource: URI

      The URI of the file to open.

    • opts: FileOpenOptions

      Options to define if the file should be created if it does not exist yet.

    Returns Promise<number>

    A promise of the file descriptor that resolves after the file is open.

  • read(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number>
  • Read specified content from a given file descriptor into a data buffer.

    Parameters

    • fd: number

      The file descriptor referencing the file to read from.

    • pos: number

      The offset from the beginning of the file from which data should be read.

    • data: Uint8Array

      The buffer that the data will be written to.

    • offset: number

      The offset in the buffer at which to start writing.

    • length: number

      The number of bytes to read.

    Returns Promise<number>

    A promise of the number of bytes read.

  • 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>
  • Write specified content from the data buffer to the file referenced by the given file descriptor.

    Parameters

    • fd: number

      The file descriptor referencing the file to write to.

    • pos: number

      The offset from the beginning of the file where this data should be written.

    • data: Uint8Array
    • offset: number

      The part of the buffer to be read from.

    • length: number

      The number of bytes to write.

    Returns Promise<number>

    A promise of the number of bytes written.

  • writeFile(resource: URI, content: Uint8Array, opts: FileWriteOptions): Promise<void>