I really like the
for (line <- Source fromFile inputPath getLines) {doSomething line}
construction for iterating over a file in scala and am wondering if there is a way to use a similar construction for iterating over the lines in all the files in a directory.
An important restriction here is that all files add up to an amount of space that would generate a heap overflow. (think dozens of GB, so increasing heap size isn't an option) As a work around for the time being, I have been cat'ing every together into one file and using the above construction which works b/c of laziness.
Point being, this seems to raise questions like.. can I concatenate two (hundred) lazy iterators and get a really big, really lazy one?