Skip to content

Attributes

Key-value metadata that can be set for any inode, versioned separately from file content.

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"
}
}

Attributes can be set using the commit operation update_attributes (see Transactions).

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.

Terminal window
loonfs annotate /reports/q3.csv --set owner=finance --set status=final
loonfs annotate /reports/q3.csv --remove status

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.

Attribute keys and values are strings, and limits are measured in units of UTF-8 bytes.

ConstraintMaximum
Attribute key length128 UTF-8 bytes
Attribute value length4,096 UTF-8 bytes
Total entries on one inode100
Total size of attributes on one inode65,536 UTF-8 bytes

See also Limits.