Attributes
Key-value metadata that can be set for any inode, versioned separately from file content.
Understanding attributes
Section titled “Understanding attributes”Attributes record arbitrary key/value metadata on a file or folder. They are applied to the underlying inode (so a rename or a move does not impact attributes).
{ "inode_id": "ino_42", "path": "/reports/q3.csv", "inode_kind": "file", "revision_no": 3, // … content_ref, size_bytes, head_seq and other hidden fields "attributes_revision_no": 7, "attributes": { "owner": "finance", "status": "final" }}Setting attributes
Section titled “Setting attributes”Attributes can be set using the commit operation update_attributes (see Transactions).
Reading attributes
Section titled “Reading attributes”statincludes attributes by default, andlistomits them by default (because a page can contain 1,000 entries). Useinclude_attributes=true` if needed.
See Stat a path and List path entries.
Attributes can be set and removed using the annotate command in the CLI.
loonfs annotate /reports/q3.csv --set owner=finance --set status=finalloonfs annotate /reports/q3.csv --remove statusAttribute revisions vs. content revisions
Section titled “Attribute revisions vs. content revisions”An inode records a revision history for attributes incremented by attributes_revision_no (not to be confused with the revision_no for content). Writing attributes does not produce a file revision, and updating content does not affect attribute revisions.
See also Revisions.
Limits
Section titled “Limits”Attribute keys and values are strings, and limits are measured in units of UTF-8 bytes.
| Constraint | Maximum |
|---|---|
| Attribute key length | 128 UTF-8 bytes |
| Attribute value length | 4,096 UTF-8 bytes |
| Total entries on one inode | 100 |
| Total size of attributes on one inode | 65,536 UTF-8 bytes |
See also Limits.