.desktop.fs
The File System API area provides secure and isolated access to the file system. It enables applications to interact with files and directories within predefined scopes, ensuring data integrity and sandboxing from the global file system.
Overview
The API area is organized into several main scopes, each serving a specific purpose:
- cache: Temporary storage that should always be used for cached data that can be purged without loss of critical information.
- data: Persistent storage for application data and files.
- pluginFs / plugin_fs: Persistent storage of a specified plugin.
These scopes help maintain data organization, security, and lifecycle management within the Liatir environment and can't be changed.
Scopes
FsPaths
| Field | Type | Description |
|---|---|---|
cache | string | Base path for the cache scope. |
data | string | Base path for the data scope. |
FsScopeMethods
Methods available on data, cache, and pluginFs / plugin_fs scopes.
FsEntry
| Field | Type | Description |
|---|---|---|
name | string | The name of the file or directory. |
path | string | The full path to the entry within the scope. |
isFile | boolean | Indicates if the entry is a file. |
isDirectory | boolean | Indicates if the entry is a directory. |
size | number | Size of the file in bytes (0 for directories). |
lastModified | Date | Timestamp of the last modification. |
IMPORTANT
FsEntry fields are always camelCase in both Node and Python, because they come from the JSON response of the Liatir bridge.
FsPluginMethods
All the following methods only apply within the specified plugin storage scope. They are identical to
FsScopeMethodswith one addition:
Example Usage
Notes
TIP
The cache namespace is intended for temporary files that will be cleared, while data and pluginFs / plugin_fs namespaces are meant for persistent files that should be preserved across sessions.
WARNING
Access through the File System API area is strictly limited to the Liatir isolated environment. It does not provide access to the global file system of the local machine, ensuring security and sandboxing.