A
Alexander Fleck
hi,
I want to walk through a directory recursively.
I have the follwing code:
'
#!/usr/bin/env ruby
def search
Dir.foreach(".\\") { |x|
if File.directory?(x)
search
else
open(x) do |file|
file.each { |l| puts l}
end
puts x
end
}
end
search
'
I get a 'stack level too deep'-error. What does that mean and how can I
avoid it?
thanks,
Alex.
I want to walk through a directory recursively.
I have the follwing code:
'
#!/usr/bin/env ruby
def search
Dir.foreach(".\\") { |x|
if File.directory?(x)
search
else
open(x) do |file|
file.each { |l| puts l}
end
puts x
end
}
end
search
'
I get a 'stack level too deep'-error. What does that mean and how can I
avoid it?
thanks,
Alex.