On Tue, Oct 19, 2010 at 10:08 PM, Daniel Berger <djberg96 / gmail.com> wrote: > > On Oct 19, 2:02 ¨Βν¬ ΣτεζαξΝιομΌστεζαξο®νι®®®ΐηναιμ®γονχςοτεΊ >> The question is: is there some class in the Ruby library that knows >> about this difference? > > File::PATH_SEPARATOR > >> I'm asking this question because I need to figure out if a given >> executable is in the path and, if it does, retrieve its full path. > > require 'ptools' > > File.which('ls') # => '/bin/ls' > > Works on Windows, too, with or without an extension: > > File.which('notepad') # Works > File.which('notepad.exe') # Also works Many thanks, Dan. I didn't know about ptools, and somehow I just saw File::SEPARATOR, but not File::PATH_SEPARATOR. -- Stefano