0

I have a bunch of files named like fn._mm* in a subdirectory:

...
./homedots/vim/plugged/YouCompleteMe/third_party/ycmd/third_party/rust-analyzer/share/doc/rust/html/core/core_arch/x86_64/avx512f/fn._mm_cvttss_i64.html
./homedots/vim/plugged/YouCompleteMe/third_party/ycmd/third_party/rust-analyzer/share/doc/rust/html/core/core_arch/x86_64/avx512f/fn._mm_cvtt_roundsd_i64.html
./homedots/vim/plugged/YouCompleteMe/third_party/ycmd/third_party/rust-analyzer/share/doc/rust/html/core/core_arch/x86_64/avx512f/fn._mm_cvt_roundss_i64.html
./homedots/vim/plugged/YouCompleteMe/third_party/ycmd/third_party/rust-analyzer/share/doc/rust/html/core/core_arch/x86_64/avx512f/fn._mm_cvtt_roundss_i64.html
./homedots/vim/plugged/YouCompleteMe/third_party/ycmd/third_party/rust-analyzer/share/doc/rust/html/core/core_arch/x86_64/avx512f/fn._mm_cvtsd_i64.html
./homedots/vim/plugged/YouCompleteMe/third_party/ycmd/third_party/rust-analyzer/share/doc/rust/html/core/core_arch/x86_64/avx512f/fn._mm_cvttsd_i64.html
./homedots/vim/plugged/YouCompleteMe/third_party/ycmd/third_party/rust-analyzer/share/doc/rust/html/core/core_arch/x86_64/avx512f/fn._mm_cvt_roundsd_i64.html
...

If I look for those files using find -iname "fn._mm*", I can find them without problems, in fact that's how I've printed the above lines.

but when using fd-find:

fd fn._mm

or

fd "fn._mm"

yields nothing. Even when using the --glob switch and an asterisk (*) at the end of my pattern, it yields nothing.

However, if I go a couple directories deeper (in the above example I'd have to cd into homedots/vim/plugged/YouCompleteMe/third_party/ycmd/third_party/rust-analyzer), I can now find the files I'm looking for with fd-find:

fd "fn._mm"
...
share/doc/rust/html/core/core_arch/x86_64/avx512f/fn._mm_cvttss_i64.html
share/doc/rust/html/core/core_arch/x86_64/avx512f/fn._mm_cvtt_roundsd_i64.html
share/doc/rust/html/core/core_arch/x86_64/avx512f/fn._mm_cvt_roundss_i64.html
share/doc/rust/html/core/core_arch/x86_64/avx512f/fn._mm_cvtt_roundss_i64.html
share/doc/rust/html/core/core_arch/x86_64/avx512f/fn._mm_cvtsd_i64.html
share/doc/rust/html/core/core_arch/x86_64/avx512f/fn._mm_cvttsd_i64.html
share/doc/rust/html/core/core_arch/x86_64/avx512f/fn._mm_cvt_roundsd_i64.html
...

--max-depth is unset in fd-find, and there are no symlinks in between (I've still checked with the -L switch to be sure, though).

Is there a bug, or is there some other limitation I'm missing?

For now, the solution is to simply use find and fd-find, when I'm unsure, however I prefer using fd-find.

polemon
  • 11,133
  • 11
  • 69
  • 111
  • 1
    Does `fd -I fn._mm` find the files? – Kamil Maciorowski Aug 10 '22 at 05:06
  • @KamilMaciorowski I'll check as soon as I'm back home. How can the restrictions be of a problem though? And is there some sort of caching in between perhaps? I was thinking perhaps I need to clear some `fd-find` cache or something... – polemon Aug 10 '22 at 08:53
  • @KamilMaciorowski it did! It seems there are some sort of `.gitignore` files in some of the subdirs that are filtering `fd`. Is this `fd`'s standard behavior? If it is, I'd need to turn it off, as it is quite annoying to me. I suppose some sort of `.fdrc` is possible? – polemon Aug 11 '22 at 21:27
  • 1
    I really don't know. My experience with `fd-find` is: I read your question, I skimmed through the manual. That's all. Now it's your turn to skim through the manual. :) – Kamil Maciorowski Aug 11 '22 at 21:31
  • @KamilMaciorowski it's fine. I was expecting `fd` to be "very similar" to `find`, didn't expect it to have said "feature", and really presumed it to be either my mistake or some sort of error. Thanks for your help! – polemon Aug 11 '22 at 22:21

0 Answers0