path:Stringmode:Stringreturn:FileorDirSameas:File#open (when path is file)Dir#open (when path is directory)modehasaneffectonlywhenpathisafile
# File lib/shell/command-processor.rb, line 114
def open(path, mode)
path = expand_path(path)
if File.directory?(path)
Dir.open(path)
else
effect_umask do
File.open(path, mode)
end
end
end