Skip to content

Commit a64da1c

Browse files
committed
Be even more explicit about future changes to mode
Add wording for the two common cases of use
1 parent 86c928d commit a64da1c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

UNIXFS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ UnixFS currently supports two optional metadata fields:
8585
If unspecified this defaults to `0755` for directories/HAMT shards and `0644` for all other types where applicable
8686
The nine least significant bits represent `ugo-rwx`
8787
The next three least significant bits represent `setuid`, `setgid` and the `sticky bit`
88-
All others are reserved for future use, and are subject to change - consumers **MUST** mask bits they do not expect, currently `& 07777`
88+
The remaining 20 bits are reserved for future use, and are subject to change. Spec implementations **MUST** handle bits they do not expect as follows:
89+
For future-proofing the (de)serialization layer must preserve the entre uint32 value during clone/copy operations, modifying only bit values that have a well defined meaning: `clonedValue = ( modifiedBits & 07777 ) | ( originalValue & 0xFFFFF000 )`
90+
Any higher level operations interpreting the value must proactively mask-off bits without a defined meaning in the current version of the spec: `interpretedValue = originalValue & 07777`
8991
* `mtime` -- The modification time in seconds since the epoch. This defaults to the unix epoch if unspecified
9092

9193
### Deduplication and inlining

0 commit comments

Comments
 (0)