# File lib/shell/command-processor.rb, line 111
def open(path, mode = nil, perm = 0666, &b)
path = expand_path(path)
if File.directory?(path)
Dir.open(path, &b)
else
if @shell.umask
f = File.open(path, mode, perm)
File.chmod(perm & [email protected], path)
if block_given?
f.each(&b)
end
f
else
File.open(path, mode, perm, &b)
end
end
end