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
Type Parameters
Section titled “Type Parameters”TBackend
Section titled “TBackend”TBackend extends string = string
Properties
Section titled “Properties”backend
Section titled “backend”
readonlybackend:TBackend
Identifier for the underlying implementation.
Examples: “disk”, “ftp”, “sftp”, “memory”, “s3”, or “dbfs”.
readonlyid:string
Unique identifier for this filesystem instance.
readOnly
Section titled “readOnly”
readonlyreadOnly:boolean
readonlyroot:string
Root location exposed by this filesystem.
Examples:
- /var/data
- ftp://example.com/files
- s3://bucket/prefix
- /Volumes/catalog/schema/volume
Methods
Section titled “Methods”appendFile()
Section titled “appendFile()”appendFile(
inputPath,content):Promise<void>
Parameters
Section titled “Parameters”inputPath
Section titled “inputPath”string
content
Section titled “content”Returns
Section titled “Returns”Promise<void>
close()
Section titled “close()”close():
Promise<void>
Release connections or other resources.
Returns
Section titled “Returns”Promise<void>
copyFile()
Section titled “copyFile()”copyFile(
sourcePath,destinationPath,options?):Promise<void>
Parameters
Section titled “Parameters”sourcePath
Section titled “sourcePath”string
destinationPath
Section titled “destinationPath”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<void>
deleteFile()
Section titled “deleteFile()”deleteFile(
inputPath,options?):Promise<void>
Parameters
Section titled “Parameters”inputPath
Section titled “inputPath”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<void>
exists()
Section titled “exists()”exists(
inputPath):Promise<boolean>
Parameters
Section titled “Parameters”inputPath
Section titled “inputPath”string
Returns
Section titled “Returns”Promise<boolean>
init()
Section titled “init()”init():
Promise<void>
Prepare, connect to, or validate the filesystem.
Returns
Section titled “Returns”Promise<void>
mkdir()
Section titled “mkdir()”mkdir(
inputPath,options?):Promise<void>
Parameters
Section titled “Parameters”inputPath
Section titled “inputPath”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<void>
moveFile()
Section titled “moveFile()”moveFile(
sourcePath,destinationPath,options?):Promise<void>
Parameters
Section titled “Parameters”sourcePath
Section titled “sourcePath”string
destinationPath
Section titled “destinationPath”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<void>
readdir()
Section titled “readdir()”readdir(
inputPath,options?):Promise<FileEntry[]>
Parameters
Section titled “Parameters”inputPath
Section titled “inputPath”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<FileEntry[]>
readFile()
Section titled “readFile()”Call Signature
Section titled “Call Signature”readFile(
inputPath):Promise<Uint8Array<ArrayBufferLike>>
Read a file as binary data.
Parameters
Section titled “Parameters”inputPath
Section titled “inputPath”string
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
Call Signature
Section titled “Call Signature”readFile(
inputPath,options):Promise<string>
Read and decode a file as text.
Parameters
Section titled “Parameters”inputPath
Section titled “inputPath”string
options
Section titled “options”ReadFileOptions & object
Returns
Section titled “Returns”Promise<string>
resolvePath()
Section titled “resolvePath()”resolvePath(
inputPath):string
Resolve a filesystem-relative path into the path understood by the underlying backend.
Parameters
Section titled “Parameters”inputPath
Section titled “inputPath”string
Returns
Section titled “Returns”string
rmdir()
Section titled “rmdir()”rmdir(
inputPath,options?):Promise<void>
Parameters
Section titled “Parameters”inputPath
Section titled “inputPath”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<void>
stat()
Section titled “stat()”stat(
inputPath):Promise<FileStat>
Parameters
Section titled “Parameters”inputPath
Section titled “inputPath”string
Returns
Section titled “Returns”Promise<FileStat>
writeFile()
Section titled “writeFile()”writeFile(
inputPath,content,options?):Promise<void>
Parameters
Section titled “Parameters”inputPath
Section titled “inputPath”string
content
Section titled “content”options?
Section titled “options?”Returns
Section titled “Returns”Promise<void>