Page 1 of 1

Extended flags (EF): third column in File Attributes

Posted: Mon Mar 29, 2021 9:49 am
by JayB
In Command > File Attributes we have two columns "User flags" (UF) and "System flags" (SF) in the second section. It would be nice to have a third column for the macOS "Extended flags" (EF), which afaik would be read-only.

The relevant section in stat.h is this:

Code: Select all

https://github.com/apple/darwin-xnu/blob/main/bsd/sys/stat.h#L543-L553
Extended flags ("EF") returned by ATTR_CMNEXT_EXT_FLAGS from getattrlist/getattrlistbulk
I don't know if this is the latest version of XNU, but judging from this we would have at least six additional inode flags to support:
  • Share blocks (EF_MAY_SHARE_BLOCKS)
  • No XAs (EF_NO_XATTRS)
  • iCloud sync root (EF_IS_SYNC_ROOT)
  • Purgeable (EF_IS_PURGEABLE)
  • Sparse (EF_IS_SPARSE)
  • Synthetic (EF_IS_SYNTHETIC)
Would be awesome to have. :)

Re: Extended flags (EF): third column in File Attributes

Posted: Sun Apr 04, 2021 8:56 pm
by mike
Yes, I want to add support for these attributes.
Need to understand first how stable this stuff actually is.

Re: Extended flags (EF): third column in File Attributes

Posted: Mon Apr 05, 2021 8:30 am
by JayB
Part of it is still a guessing game, it seems, specifically regarding the MAY_SHARE_BLOCKS and IS_SPARSE flags.

Here are two articles about that, primary emphasis on clones:
https://eclecticlight.co/2021/04/02/how ... d-in-apfs/
https://eclecticlight.co/2021/04/05/exp ... rsity-1-2/

The first article also lists something called the j_inode_flags, which seem to be their own thing, apart from the EFs (extended flags). There you also have

INODE_IS_SPARSE
INODE_WAS_EVER_CLONED
INODE_WAS_CLONED

More articles on EclecticLight via the article tags, e.g. this one on sparse files: https://eclecticlight.co/2021/03/29/spa ... n-in-apfs/