title: Is there a faster alternative to Ruby's Dir.glob?
body: <p>I'm using Dir.glob to visit the set of all files matching a wildcard pattern.</p>
  
  <pre><code>Dir.glob( '**/*.txt' ) { |file_name|
      parse file_name
  }
  </code></pre>
  
  <p>Because this glob call is recursive and because lots of files are involved, glob takes a long time to build the array of files before the block starts.</p>
  
  <p>What I want instead is a way of visiting all of the same files, but calling the block immediately after Ruby "discovers" each file, so that the first file is processed right away rather than after waiting for the whole directory tree to finish being searched.</p>
  
  <p>Is there such a construction?</p>