Extended flags (EF): third column in File Attributes

Any wishes
Locked
JayB
Posts: 192
Joined: Sun Jan 08, 2017 4:38 pm

Extended flags (EF): third column in File Attributes

Post by JayB » Mon Mar 29, 2021 9:49 am

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. :)

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

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

Post by mike » Sun Apr 04, 2021 8:56 pm

Yes, I want to add support for these attributes.
Need to understand first how stable this stuff actually is.

JayB
Posts: 192
Joined: Sun Jan 08, 2017 4:38 pm

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

Post by JayB » Mon Apr 05, 2021 8:30 am

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/

Locked