0

I'm trying do some operations on a directory which contains nearly 20 million files, I tried Dir.glob, Dir.foreach and Dir.entries to no success.
Is there anything similar to Csharp's Directory.EnumerateFiles in ruby which can enumerate a huge list of files?

Jeremy Mc
  • 119
  • 1
  • 10
  • 2
    _"... to no success"_ – please be more specific. What happens and how do you use these methods? (i.e. show some code) – Stefan Oct 04 '16 at 12:10

1 Answers1

0

Dir#read might do the trick.

dir = Dir.new(path)
while entry = dir.read
  puts entry
end
Kimmo Lehto
  • 5,910
  • 1
  • 23
  • 32