Now the Dir object is useless until we call Dir#rewind. : Dir rewind « File Directory « Ruby






Now the Dir object is useless until we call Dir#rewind.


d = Dir.open('mydir')
d.reject { |f| f[0] == '.' }

d.entries.size                                      # => 0
d.rewind
d.entries.size                                      # => 6
d.close

 








Related examples in the same category