Hacker News new | ask | show | jobs
by mdellabitta 3848 days ago
Actually, I believe OS X does this for small files in order to not burn a whole filesystem block on a sub 1k file.

"In Mac OS X Snow Leopard 10.6, HFS+ compression was added. In open source and some other areas this is referred to as AppleFSCompression. Compressed data may be stored in either an extended attribute or the resource fork.[13] When using non-Apple APIs, AppleFSCompression is not always completely transparent."

https://en.wikipedia.org/wiki/HFS_Plus#History

1 comments

FS compression is transparent to any regular file-reading API; it only shows up in lower-level APIs, like if you want to copy the file and keep the compression.
I was responding to the comment "You wouldn't put the entire content of a file in an extended attribute, would you?" HFS+ does, although in this case, it does without leaking that detail to callers.