Skip to content

.desktop.fs ​

The File System API reads and writes files inside Liatir-managed storage scopes. Node, Python, R and Native can all use it. These scopes organize bridge access; they do not sandbox the language's own operating-system APIs. WASM uses its own sandbox mounts and has no access to this bridge.

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.

Use paths relative to the chosen scope. During liatir dev, storage is redirected to the temporary session and workspace; it is removed at session end.

Scopes ​

FsPaths ​

FieldTypeDescription
cachestringBase path for the cache scope.
datastringBase path for the data scope.

FsScopeMethods ​

Methods available on data, cache, and pluginFs / plugin_fs scopes.

FsEntry ​

FieldTypeDescription
namestringThe name of the file or directory.
pathstringThe full path to the entry within the scope.
is_dirbooleanWhether the entry is a directory.
sizenumber or nullFile size in bytes; null for directories.

IMPORTANT

FsEntry uses name, path, is_dir and size in every language. The SDK preserves the backend JSON response without renaming fields.

FsPluginMethods ​

All the following methods only apply within the specified plugin storage scope. They are identical to FsScopeMethods with 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.

Paths passed to this API stay within their managed scope. Node, Python, R and Native programs can separately use their language's filesystem APIs; this bridge is not an operating-system sandbox.

R and Native remove their temporary Job directory at termination. If returning a file path, write it to managed storage first and return that absolute path, or return inline content. Use unique paths per run to avoid overwriting another concurrent run's output.