in reply to Writing to many (>1000) files at once

A possible alternative would be to use a database: rather than sending all output directly to its intended, "save" all items to a database with as primary key the intended output file. Probably you must also save a sequence number so the messages come out in the right order.

Once you have processed all data, start outputting from the database by ordering the data per "intended output file" and sequence number. At each change of "intended output file" close the previous file and open a new one.

When all is done "clean" your database so it is ready for its next run.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

  • Comment on Re: Writing to many (>1000) files at once