Details
-
Improvement
-
Resolution: Fixed
-
Minor
-
None
-
9223372036854775807
Description
It would be useful if "lfs find" could check/match xattrs on files.
This should use "--xattr <name>" to match files that have a <name> xattr, and "--xattr-match <name>=<value>", where <name> and <value> are shell patterns that can match arbitrary text strings in the xattr. The output would be printed in plain text with escaped control characters.
Attachments
Issue Links
- is related to
-
LU-17219 lfs find: add ability to print extended attributes
-
- Open
-
-
LU-18889 "lfs find -printf" optimization
-
- Open
-
-
LU-15837 "lfs find -printf" improvements
-
- Resolved
-
-
LU-16760 "lfs find" support for fscrypt and other file attributes
-
- Resolved
-
- is related to
-
LU-5170 lfs usability
-
- Open
-
-
LU-13031 store JobID of program that created file in inodes at create time
-
- Resolved
-
-
LU-16798 lfs find: new --jobid option
-
- Closed
-
Andreas, adding a question here instead of on the Gerrit review about the regex matching issue, since it's more of a user interface / design question.
It looks like GNU find uses a non-POSIX regex interface from Gnulib, and its matching function re_match returns the number of chars matched. So GNU find accomplishes this with basically
if (re_match(..., path, ...) == strlen(path)) ...
It should be possible to achieve the same result with the POSIX regex interface using the pmatch[] argument to regexec, like this:
Alternatively, with the current behavior, matching the entire string could be accomplished by the user with anchors:
This could be documented/suggested in the man page to make it clear to the user if they want this behavior.
A final option could be to use the Gnulib regex instead of POSIX regex for lfs find, but I'm not sure if that really makes sense.
What do you think is the best option?