Files
metasploit-gs/lib/rex/file.rb
T
Matt Miller 15ce3c424b added is_usable check
git-svn-id: file:///home/svn/incoming/trunk@3003 4d416f70-5f16-0410-b530-b9f4589650da
2005-11-02 14:18:50 +00:00

34 lines
541 B
Ruby

module Rex
###
#
# This class provides helper mehods for dealing with files that are not
# supplied by the standard ruby API.
#
###
module FileUtils
#
# This method searches the PATH environment variable for
# a fully qualified path to the supplied file name.
#
def self.find_full_path(file_name)
if (ENV['PATH'])
ENV['PATH'].split(':').each { |base|
begin
path = base + ::File::SEPARATOR + file_name
if (::File::Stat.new(path))
return path
end
rescue
end
}
end
return nil
end
end
end