[patch #9754] find: new '-attr' predicate to test inode flags

Matt Whitlock <[email protected]> Tue, 14 Jul 2026 12:37:59 -0400 (EDT)
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <[email protected]>
--8323329-1649760492-1784047079=:3929132
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline

Follow-up Comment #4, patch #9754 (group findutils):=0A=0A[comment #3 comme=
nt #3:]=0A> FreeBSD uses -flags for a similar feature.  It may be worth usi=
ng the same=0A> name.  -attr sounds like it might refer to extended attribu=
tes rather than=0A> inode flags IMO.=0A=0AExtended attributes would be refe=
rred to as "xattr" on Linux. That's an=0Aestablished convention reflected i=
n the names of the syscalls: getxattr,=0Algetxattr, fgetxattr, getxattrat, =
listxattr, llistxattr, flistxattr,=0Alistxattrat, setxattr, lsetxattr, fset=
xattr, setxattrat, removexattr,=0Alremovexattr, fremovexattr, removexattrat=
. Alternatively, extended attributes=0Acould conceivably be referred to as =
"fattr" since the userspace commands for=0Agetting and setting them are 'ge=
tfattr' and 'setfattr'. However, nowhere are=0Aextended attributes referred=
 to simply as "attr".=0A=0AI chose "attr" to refer to the inode flags becau=
se userspace consistently=0Arefers to these flags as "file attributes," and=
 the userspace commands for=0Alisting and changing them are 'lsattr' and 'c=
hattr'. Also, the 'statx' system=0Acall returns them in a field named 'stx_=
attributes' using constants named like=0A"STATX_ATTR_*".=0A=0AOn the other =
hand, the 'xfs_io' command has 'lsattr' and 'chattr' subcommands,=0Aand its=
 man page does mention that those commands list and change the=0A"extended =
inode flags." Also, the original ext2 ioctls were named=0AEXT2_IOC_GETFLAGS=
 and EXT2_IOC_SETFLAGS=E2=80=8E. However, confusingly, XFS has=0Aioctls XFS=
_IOC_FSGETXATTR and XFS_IOC_FSSETXATTR that pass a data structure=0Athat ca=
rries the extended inode flags in a field named 'fsx_xflags'.=0A=0ADespite =
the apparently rampant inconsistency in what to call these things=0Athrough=
out the source codes, the user-facing commands are consistently named=0A'ls=
attr' and 'chattr', so keeping '-attr' for the name of the user-facing=0A'f=
ind' predicate makes the most sense.=0A=0A=0A    __________________________=
_____________________________=0A=0AReply to this item at:=0A=0A  <https://s=
avannah.gnu.org/patch/?9754>=0A=0A_________________________________________=
______=0AMessage sent via Savannah=0Ahttps://savannah.gnu.org/=0A
--8323329-1649760492-1784047079=:3929132
Content-Type: APPLICATION/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCalZl5wAKCRCqLAuaBUf3
TvuNAP9S5Hshm1CTAC7G1YjgF5vK5ylFgZOxeoWU9PGV1HnUYgD/TfYls8gCIfKm
n0q4ht6TETGHXTHe/34ckN1OetF42w8=
=5101
-----END PGP SIGNATURE-----

--8323329-1649760492-1784047079=:3929132--