foreach(path = nil, *rs)
public
File related commands Shell#foreach Shell#open
Shell#unlink Shell#test
-
CommandProcessor#foreach(path, rs)
path: String
rs: String - record separator
iterator
Same as:
File
Dir
path is relative to pwd
Show source
def foreach(path = nil, *rs)
path = "." unless path
path = expand_path(path)
if File.directory?(path)
Dir.foreach(path){|fn| yield fn}
else
IO.foreach(path, *rs){|l| yield l}
end
end