What is a file? (in ofsf)
Overview
An OFSF file record is a fixed-length collection of 14 ordered fields describing either a file or a folder. Records are positional (index-based), not keyed.
Unless otherwise stated, all fields are required to exist by position, even if unused.
Field Layout
1
Type
File type identifier. For regular files, this is the file extension (e.g. .txt, .osl, .icn). Folders MUST use the literal .folder.
2
Name
File name without extension, stored as a string. Example: "hello" for hello.txt.
3
Location
Full path of the parent directory, expressed as a string. Example: origin/(c) users/mist/documents.
4
Data
Primary payload. Meaning depends on whether the record is a file or a folder (see below).
5
Padding A
Reserved / padding field. May contain any value (commonly 0 or ""). Consumers MUST ignore it.
6
X
Auxiliary numeric or scalar field. Typically used for X position in a parent container (e.g. desktop layout).
7
Y
Auxiliary numeric or scalar field, similar to X (e.g. Y position).
8
Padding B
Reserved / padding field. May contain any value (commonly 0 or ""). Consumers MUST ignore it.
9
Created
Creation timestamp in Unix milliseconds.
10
Edited
Last-edited timestamp in Unix milliseconds.
11
Icon
ICN code representing the file's icon.
12
Size
Size metric. For files: character count. For folders: number of contained items.
13
Permissions
JSON-encoded array of permission strings.
14
UUID
System-generated unique identifier. Primary identifier for the record.
Field 4: Data (Disambiguation)
Files
For all non-folder items, field 4 stores the file’s primary content.
No semantic meaning is derived from file type here
Data is a string
Folders
For .folder items, field 4 represents the folder’s contents.
Allowed encodings:
or JSON-string-encoded:
Consumers MUST accept both representations.
Permissions Encoding (Field 13)
Permissions are stored as a JSON-encoded array of strings:
or encoded as a string:
Filesystem consumers MUST decode before interpretation.
Padding Fields (5 & 8)
Fields 5 and 8 are padding / legacy fields.
They do not need to be
nullAny value is valid
Implementations MUST NOT rely on their contents
Timestamp Semantics
Fields 9 (Created) and 10 (Edited) are:
Unix timestamps
Milliseconds, not seconds
Notes for Implementers
OFSF is positional, not schema-keyed
Consumers should be permissive in decoding (stringified JSON vs native arrays)
UUID (field 14) is the only authoritative identifier
Folderness is determined solely by field 1 being
.folder
Last updated