Skip to content

.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

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.
isFilebooleanIndicates if the entry is a file.
isDirectorybooleanIndicates if the entry is a directory.
sizenumberSize of the file in bytes (0 for directories).
lastModifiedDateTimestamp 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 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.

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.