The Crystal Programming Language Forum

Can’t iterate over a more than one time

Why is it impossible to iterate over more than one time?

Usually I do:

my_dir = “./“
my_dir.each_child { iterate success }
my_dir.each_child { doesn’t iterate again }

See Is there a reason you need the Dir instance as opposed to just doing like Dir.each_child "./" { |x| puts x }?