dcjones / quip

Compressing next-generation sequencing data with extreme prejudice.
http://www.cs.washington.edu/homes/dcjones/quip/
BSD 3-Clause "New" or "Revised" License
78 stars 10 forks source link

Output to temp file during compression, then rename after #14

Closed DarwinAwardWinner closed 11 years ago

DarwinAwardWinner commented 11 years ago

When outputting to a file (and not stdout), quip should create a tempoprary file with a random name and output to that, and then once (de)compression is complete, rename the file to the desired destination. This ensures that if quip is interrupted before completion, it will not produce an incomplete output file.

dcjones commented 11 years ago

Good point regarding incomplete output files. I'm more inclined to emulate standard unix compression tools (e.g., gzip, bzip2) which don't use a temporary file, but delete the incomplete output files if interrupted. I'll look into copying their signal handling logic to do the same.

dcjones commented 11 years ago

This has been aded in version 1.1.4. (Source tarball)