Fd: RFE: Add --perm flag

Created on 31 Dec 2019  Â·  3Comments  Â·  Source: sharkdp/fd

In conjunction with #328 (specifically the --owner option), please consider adding a --perm flag accepting the standard four digit permission format as a filter

help wanted question

All 3 comments

Thank you for your feedback.

I always a little hesitant to add new options to fd. This one in particular, because it would be OS specific.

accepting the standard four digit permission format

What do you mean by "standard four digit … format"? I am familar with the user/group/other three digit format (e.g. 644), but what would the fourth digit be?

Apart from that, I have several questions:

  • Most importantly: What are actual real world use cases where this option would be useful? If --perm 644 simply searches for files with permissions set to 644 exactly, I don't really see much use for this. I'd rather expect queries like "files/directories which are writable/readable by me" or "files/directories which are NOT writable/readable by me" to be useful.
  • find seems to have invented a whole new syntax for permission filters (-perm mode, -perm -mode, -perm /mode), which goes a long with the find-specific logic operations for negation, conjunction, disjunction, etc. I am not planning to implement such a complex logic system within fd. Is this option really going to be useful without all of this?
  • How are we going to deal with other operating systems? I'd really like to avoid having a completely UNIX-centric command line option like --perm UGO. find has several more options dealing with permissions (-readable, -writable), which sound a bit more appealing to me. Those could probably also be implemented in a OS-independent way(?).

but what would the foruth digit be?

The fourth digit is actually the first one, which is usually omitted or 0. It is used for the setuid, setgid, and restricted-deletion/sticky flags. The chmod man page has more information on them.

Might be related to #400.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Dietr1ch picture Dietr1ch  Â·  3Comments

ariecattan picture ariecattan  Â·  3Comments

sharkdp picture sharkdp  Â·  3Comments

mrzool picture mrzool  Â·  4Comments

matu3ba picture matu3ba  Â·  4Comments