    # File lib/facets/core/fileutils/which.rb, line 28
      def which(prog, path=ENV['PATH'])
        path.split(File::PATH_SEPARATOR).each {|dir|
          # Windows checks against specific extensions
          if File::ALT_SEPARATOR
            ext = Win32Exts.find{|ext|
              if prog.include?('.') # Assume extension already included
                f = File.join(dir,prog)
              else
                f = File.join(dir,prog+ext)
              end
              File.executable?(f) && !File.directory?(f)
            }
            if ext
              # Use backslashes, not forward slashes
              if prog.include?('.') # Assume extension already included
                f = File.join( dir, prog ).gsub(/\//,'\\')
              else
                f = File.join( dir, prog + ext ).gsub(/\//,'\\')
              end
              return f
            end
          else
            f = File.join(dir,prog)
            # Avoid /usr/lib/ruby, for example
            if File.executable?(f) && !File.directory?(f)
              return File::join( dir, prog )
            end
          end
        }
        nil
      end