Skip to content

Interface: FileSystem\<TBackend\>

A filesystem rooted at a local, remote, or virtual location.

Possible implementations include:

  • Local disk
  • FTP or SFTP
  • Object storage
  • In-memory storage
  • Databricks
  • Database-backed storage

TBackend extends string = string

readonly backend: TBackend

Identifier for the underlying implementation.

Examples: “disk”, “ftp”, “sftp”, “memory”, “s3”, or “dbfs”.


readonly id: string

Unique identifier for this filesystem instance.


readonly readOnly: boolean


readonly root: string

Root location exposed by this filesystem.

Examples:

  • /var/data
  • ftp://example.com/files
  • s3://bucket/prefix
  • /Volumes/catalog/schema/volume

appendFile(inputPath, content): Promise<void>

string

FileContent

Promise<void>


close(): Promise<void>

Release connections or other resources.

Promise<void>


copyFile(sourcePath, destinationPath, options?): Promise<void>

string

string

CopyOptions

Promise<void>


deleteFile(inputPath, options?): Promise<void>

string

RemoveOptions

Promise<void>


exists(inputPath): Promise<boolean>

string

Promise<boolean>


init(): Promise<void>

Prepare, connect to, or validate the filesystem.

Promise<void>


mkdir(inputPath, options?): Promise<void>

string

MakeDirectoryOptions

Promise<void>


moveFile(sourcePath, destinationPath, options?): Promise<void>

string

string

CopyOptions

Promise<void>


readdir(inputPath, options?): Promise<FileEntry[]>

string

ListOptions

Promise<FileEntry[]>


readFile(inputPath): Promise<Uint8Array<ArrayBufferLike>>

Read a file as binary data.

string

Promise<Uint8Array<ArrayBufferLike>>

readFile(inputPath, options): Promise<string>

Read and decode a file as text.

string

ReadFileOptions & object

Promise<string>


resolvePath(inputPath): string

Resolve a filesystem-relative path into the path understood by the underlying backend.

string

string


rmdir(inputPath, options?): Promise<void>

string

RemoveOptions

Promise<void>


stat(inputPath): Promise<FileStat>

string

Promise<FileStat>


writeFile(inputPath, content, options?): Promise<void>

string

FileContent

WriteFileOptions

Promise<void>