4 ms·
Emulating extended attributes for a filesystem is a fascinating approach. It can significantly streamline lightweight OS customization without needing a full po
by sockboy 1y ago
Emulating extended attributes for a filesystem is a fascinating approach. It can significantly streamline lightweight OS customization without needing a full port of the filesystem driver. Has anyone experimented with this in open-source projects? Would love to hear about practical results or challenges.
- wmf 1y agoLinux has supported xattrs for many years; there's no need to emulate them.
- jdboyd 1y agoLinux's xattrs appear to only be an array of bytes, while Haiku's extended attributes are typed (string, mime, int, llong, float, double, bool, icon, or raw). This means a compatibility layer is probably needed to handle encoding types into the value of the xattr. Xattr(7) says there is a limit of 64kb for the value. Some haiku programs allegedly use more, but i dont have an example handy. Further, specific file systems may impose additional restrictions. For instance ext4 requires all xattrs to fit in a single file system block (assuming that the man page I'm reading is not out of date).
- jonhohle 1y agoFor compressed files, HFS+ puts the entire contents in an (xattr né resource fork).
- yencabulator 1y agomacOS resource forks values are "file-like" with position-based "block" read/write, Linux xattrs is a key-value map with atomic get/set operations on the whole value only.