Expand description
Access the file system.
The APIs must be added to tauri.allowlist.fs
in tauri.conf.json
:
{
"tauri": {
"allowlist": {
"fs": {
"all": true, // enable all FS APIs
"readFile": true,
"writeFile": true,
"readDir": true,
"copyFile": true,
"createDir": true,
"removeDir": true,
"removeFile": true,
"renameFile": true,
"exists": true
}
}
}
}
It is recommended to allowlist only the APIs you use for optimal bundle size and security.
Structs§
Enums§
Functions§
- Copies a file to a destination.
- Creates a directory. If one of the path’s parent components doesn’t exist the promise will be rejected.
- Creates a directory recursively.
- Checks if a path exists.
- Reads a file as a byte array.
- List directory files.
- List directory files recursively.
- Read a file as an UTF-8 encoded string.
- Removes a directory. If the directory is not empty the promise will be rejected.
- Removes a directory and its contents.
- Removes a file.
- Renames a file.
- Writes a byte array content to a file.
- Writes a UTF-8 text file.