What I would generally do in this case is to "start with a presumed-empty directory that has been specified by the user." Now, each time the chromosome changes, open the appropriate target file in
mode. Yes, it will be necessary for the user to be sure in-advance that the target directory is empty, but that should be fine. The program will now open each file (if it already exists) positioned at the end-of-file, or will create the file if it is new.