directory?()
click to toggle source
def directory?
finder.protect_from_errors { s = finder_stat and s.directory? }
end
exist?()
click to toggle source
def exist?
finder.protect_from_errors { File.exist?(self) }
end
file()
click to toggle source
def file
finder.protect_from_errors do
File.new(self) if file?
end
end
file?()
click to toggle source
def file?
finder.protect_from_errors { s = finder_stat and s.file? }
end
finder_stat()
click to toggle source
def finder_stat
finder.protect_from_errors do
finder.follow_symlinks ? File.stat(self) : File.lstat(self)
end
end
lstat()
click to toggle source
def lstat
finder.protect_from_errors { File.lstat(self) }
end
pathname()
click to toggle source
def pathname
Pathname.new(self)
end
stat()
click to toggle source
def stat
finder.protect_from_errors { File.stat(self) }
end
suffix()
click to toggle source
def suffix
pathname.extname[1..-1] || ''
end