Open JakkuSakura opened 2 months ago
Hi @JakkuSakura - I assume you mean the FindFiles
or similar facts? Extending the arguments taken should be pretty simple and allow specifying any find
flags, source: https://github.com/pyinfra-dev/pyinfra/blob/aad6c3b84afc56f40c36b9e53dd277ce3c51b916/pyinfra/facts/files.py#L325-L330
Yeah I mean the find files. If my proposal sounds plausible, I'd happy to implement it to support any parameters + footgun prevention mechanisms
Is your feature request related to a problem? Please describe
Many times, I want to filter certain kinds of files, yet find can only show if a file exists. This could also be a performance issue when the number of files are larger.
Describe the solution you'd like
I would like to add a few arguments to Find.
Below are some maybe useful arguments I copied from
man find
. One shall also be able to pass custom arguments to get_fact(Find).Pay special attention to
-size n[ckMGTP]
.1k/M/G/T/P
has pitfall and behave like all non-empty files. one should always use n c(chars) to work around