harryfei / which-rs

A Rust equivalent of Unix command "which".

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"cannot find binary path" for non-executable file

edward-shen opened this issue · comments

Is there any way to warn users that a file was found but was skipped because it failed to have the executable bit set?

For context, I ran into this issue trying to figure out why my program couldn't find this one file. I spent hours trying to figure out if there was some weird PATH issue or environment only to finally identify that the error was misleading. In this case, the binary path did exist, but simply wasn't marked executable.

I'd be happy to make a PR for this but I wanted to get approval first.

commented

which-rs mimic command line which on Linux platforms. I believe that which filters non-executables also.
If you really want this feature, it's acceptable to have a option to control whether which-rs ignore non-executables.