-
-
Notifications
You must be signed in to change notification settings - Fork 5
File.whereis
Daniel Berger edited this page Aug 22, 2018
·
1 revision
Returns an array of each program
within path
, or nil if it cannot be found.
On MS Windows, it looks for executables ending with the suffixes defined in your PATHEXT
environment variable, or '.exe', '.bat' and '.com' if that isn't defined, which you may optionally include in the program
argument.
Examples:
File.whereis('ruby') # => ['/usr/bin/ruby', '/usr/local/bin/ruby']
File.whereis('foo') # => nil