Defined in: fs.ts:197
A scoped file handle (upstream FileHandle parity): reads/writes advance
an internal cursor; close() flushes buffered writes.
new FileHandle(
id,path):FileHandle
Defined in: fs.ts:202
Internal
— create via open.
number
string
readonlyid:number
Defined in: fs.ts:198
readonlypath:string
Defined in: fs.ts:199
close():
Promise<void>
Defined in: fs.ts:244
Flushes and releases the handle.
Promise<void>
flush():
Promise<void>
Defined in: fs.ts:239
Flushes buffered writes to disk.
Promise<void>
read(
length):Promise<Uint8Array<ArrayBufferLike>>
Defined in: fs.ts:208
Reads up to length bytes from the cursor (base64 on the wire).
number
Promise<Uint8Array<ArrayBufferLike>>
seek(
offset,whence?):Promise<number>
Defined in: fs.ts:227
whence: "start" (default) | "current" | "end".
number
"end" | "start" | "current"
Promise<number>
write(
data):Promise<number>
Defined in: fs.ts:217
Writes bytes at the cursor (advances it).
ArrayBuffer | Uint8Array<ArrayBufferLike>
Promise<number>
Defined in: fs.ts:24
isDirectory:
boolean
Defined in: fs.ts:26
isFile:
boolean
Defined in: fs.ts:27
name:
string
Defined in: fs.ts:25
Defined in: fs.ts:115
isDirectory:
boolean
Defined in: fs.ts:117
isFile:
boolean
Defined in: fs.ts:118
modifiedAt:
string|null
Defined in: fs.ts:119
size:
number
Defined in: fs.ts:116
Defined in: fs.ts:9
Optional trailing options accepted by the v1 fs functions.
optionalbaseDir?:string
Defined in: fs.ts:11
Resolve a relative path against this base directory first.
Defined in: fs.ts:77
Options for makeDir.
optionalrecursive?:boolean
Defined in: fs.ts:79
Create parent directories as needed; no error if the dir exists.
Defined in: fs.ts:182
Options for open.
optionalappend?:boolean
Defined in: fs.ts:186
Position writes at EOF (implies write).
optionalbaseDir?:string
Defined in: fs.ts:190
Base directory for relative paths.
optionalcreate?:boolean
Defined in: fs.ts:188
Create the file when missing (with write/append).
optionalread?:boolean
Defined in: fs.ts:183
optionalwrite?:boolean
Defined in: fs.ts:184
Defined in: fs.ts:138
A filesystem watch event (aligned with Tauri's watchEvent).
path:
string
Defined in: fs.ts:143
Path of the changed entry (relative to the watched dir when the dir was watched; the file itself when a file was watched).
type:
"modify"|"rename"
Defined in: fs.ts:140
"modify" (content change) | "rename" (create/delete/move).
constfs:object
Defined in: fs.ts:164
copyFile: (
path,dest) =>Promise<void>
Copies a file (both source and destination must be in scope).
string
string
Promise<void>
exists: (
path,options?) =>Promise<boolean>
Checks whether a path exists (out-of-scope paths report false).
string
Promise<boolean>
makeDir: (
path,options?) =>Promise<void>
string
Promise<void>
readDir: (
path,options?) =>Promise<DirEntry[]>
Lists a directory.
string
Promise<DirEntry[]>
readFile: (
path) =>Promise<Uint8Array<ArrayBufferLike>>
Reads a binary file; resolves with its raw bytes (raw IPC response — the injected invoke already unwraps the backend envelope).
string
Promise<Uint8Array<ArrayBufferLike>>
readText: (
path,options?) =>Promise<string>
Reads a text file (decoded as UTF-8).
string
Promise<string>
remove: (
path) =>Promise<void>
Removes a file (or empty directory).
string
Promise<void>
renameFile: (
path,newPath) =>Promise<void>
Renames/moves a file (both paths must be in scope).
string
string
Promise<void>
stat: (
path) =>Promise<FileMeta>
Stats a file, returning size/type/last-modified.
string
Promise<FileMeta>
watch: (
path,handler) =>Promise<() =>Promise<void>>
Watches a path for changes. Resolves with an unwatch function once the
backend watcher is armed; events stream through handler afterwards.
The path must be inside the app's fs scope (like every fs API).
string
(event) => void
Promise<() => Promise<void>>
writeFile: (
path,data) =>Promise<void>
Writes a binary file from raw bytes (or a base64 string directly).
string
string | Uint8Array<ArrayBufferLike>
Promise<void>
writeText: (
path,contents,options?) =>Promise<void>
Writes a text file.
string
string
Promise<void>
chmod(
path,mode,options?):Promise<void>
Defined in: fs.ts:312
Changes file permission bits (unix mode).
string
number
Promise<void>
copyFile(
path,dest):Promise<void>
Defined in: fs.ts:123
Copies a file (both source and destination must be in scope).
string
string
Promise<void>
exists(
path,options?):Promise<boolean>
Defined in: fs.ts:62
Checks whether a path exists (out-of-scope paths report false).
string
Promise<boolean>
lstat(
path,options?):Promise<{isSymlink:boolean;mode:number;size:number; }>
Defined in: fs.ts:281
stat without following symlinks.
string
Promise<{ isSymlink: boolean; mode: number; size: number; }>
makeDir(
path,options?):Promise<void>
Defined in: fs.ts:108
string
Promise<void>
open(
path,options?):Promise<FileHandle>
Defined in: fs.ts:266
Opens a scoped file handle.
string
OpenOptions = {}
Promise<FileHandle>
readDir(
path,options?):Promise<DirEntry[]>
Defined in: fs.ts:52
Lists a directory.
string
Promise<DirEntry[]>
readFile(
path):Promise<Uint8Array<ArrayBufferLike>>
Defined in: fs.ts:85
Reads a binary file; resolves with its raw bytes (raw IPC response — the injected invoke already unwraps the backend envelope).
string
Promise<Uint8Array<ArrayBufferLike>>
readLink(
path,options?):Promise<string>
Defined in: fs.ts:291
Reads a symlink target.
string
Promise<string>
readText(
path,options?):Promise<string>
Defined in: fs.ts:31
Reads a text file (decoded as UTF-8).
string
Promise<string>
remove(
path):Promise<void>
Defined in: fs.ts:72
Removes a file (or empty directory).
string
Promise<void>
renameFile(
path,newPath):Promise<void>
Defined in: fs.ts:128
Renames/moves a file (both paths must be in scope).
string
string
Promise<void>
stat(
path):Promise<FileMeta>
Defined in: fs.ts:133
Stats a file, returning size/type/last-modified.
string
Promise<FileMeta>
truncate(
path,length,options?):Promise<void>
Defined in: fs.ts:301
Truncates (or zero-extends) a file to length bytes.
string
number
Promise<void>
watch(
path,handler):Promise<() =>Promise<void>>
Defined in: fs.ts:151
Watches a path for changes. Resolves with an unwatch function once the
backend watcher is armed; events stream through handler afterwards.
The path must be inside the app's fs scope (like every fs API).
string
(event) => void
Promise<() => Promise<void>>
writeFile(
path,data):Promise<void>
Defined in: fs.ts:90
Writes a binary file from raw bytes (or a base64 string directly).
string
string | Uint8Array<ArrayBufferLike>
Promise<void>
writeText(
path,contents,options?):Promise<void>
Defined in: fs.ts:41
Writes a text file.
string
string
Promise<void>