refactored file IO and zupport for sips

This commit is contained in:
gnembon committed 2021-03-20 06:22:23 -03:00
1 parent f8208c8334
commit 1a47f4333f
10 files changed
+335 -482

No files matched your search

+7 -2
View File
@@ -298,7 +298,8 @@ Resource is identified by a path to the file.
A path can contain letters, numbers, characters `-`, `+`, or `_`, and a folder separator: `'/'`. Any other characters are stripped
from the name. Empty descriptors are invalid, except for `list_files` where it means the root folder.
Do not add file extensions to the descriptor - extensions are inferred
based on the `type` of the file.
based on the `type` of the file. A path can have one `'.zip'` component indicating a zip folder allowing to read / write to and from
zip files, although you cannot nest zip files in other zip files.
Resources can be located in the app specific space, or a shared space for all the apps. Accessing of app-specific
resources is guaranteed to be isolated from other apps. Shared resources are... well, shared across all apes, meaning
@@ -312,7 +313,7 @@ specific data directory is under `world/scripts/foo.data/...`, and shared data s
The default no-name app, via `/script run` command can only save/load/read files from the shared space.
Functions return `null` if an error is encounter or no file is present (for read, list and delete operations). Returns `true`
Functions return `null` if no file is present (for read, list and delete operations). Returns `true`
for success writes and deletes, and requested data, based on the file type, for read operations. It returns list of files
for folder listing.
@@ -336,6 +337,10 @@ third argument.
Throws:
- `nbt_read_error`: When failed to read NBT file.
- `json_read_error`: When failed to read JSON file. The exception data will contain details about the problem.
- `io_exception`: For all other errors when handling data on disk not related to encoding issues
All other errors resulting of improper use of input arguments should result in `null` returned from the function, rather than exception
thrown.
<pre>
write_file('foo', 'shared_text, ['one', 'two']);