-
Notifications
You must be signed in to change notification settings - Fork 18
pyio.get_scratch_folder_path
Daniel Flassig edited this page Jul 7, 2026
·
1 revision
Returns a path handle to the plugin's own private scratch folder.
Each plugin has a private scratch folder in which it may read, write and delete files without restriction. It is the place for data that is not easily expressed as key-value pairs and therefore not a good fit for pyio.save_values / pyio.load_values. The folder is created automatically the first time it is requested.
pyio.get_scratch_folder_path()
pyio.get_scratch_folder_path(rel_path)| Parameter | Type | Description |
|---|---|---|
rel_path |
string |
(Optional) A relative path below the scratch folder. Both \ and / are accepted as separators. .. components, invalid characters, and a leading separator are rejected. |
| Type | Description |
|---|---|
path handle |
A recursive, writable handle. Without rel_path it refers to the scratch folder itself; with rel_path it refers to the addressed location below it. |
local scratch = pyio.get_scratch_folder_path()
local cache = pyio.get_scratch_folder_path("cache/geometry.dat")
pyio.write_lines(cache, lines)Unlike pyio.get_plugin_folder_path, the addressed location is not required to exist: rel_path typically names a write target that is only created when it is written to.
The function will raise an error if
-
rel_pathuses a leading separator, a..component, or an invalid character
Minimum PYTHA Version: V26
pyio, Path Handles, pyio.get_plugin_folder_path, pyio.append_path, pyio.list_folder, pyio.save_values