Reading a file N lines at a time in ruby

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2010-03-23T01:58:11Z Indexed on 2010/03/23 2:01 UTC
Read the original article Hit count: 309

Filed under:
|
|

I have a large file (hundreds of megs) that consists of filenames, one per line.

I need to loop through the list of filenames, and fork off a process for each filename. I want a maximum of 8 forked processes at a time and I don't want to read the whole filename list into RAM at once.

I'm not even sure where to begin, can anyone help me out?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about file-io