precomp-cpp
precomp-cpp copied to clipboard
Corrupted PCF behavior
When PCF file is corrupted PreComp does... nothing!
- I change 1 byte in -cn PCF - recovered via -r file differs from original in 1 byte (one case, may be others);
- if PCF is compressed (-cb or -cl) - I get error bzip2 or lzma stream corrupted, but precomp leaves tempfile and target partial file in directory.
I think this behavior is extremely wrong. It must check consistency of PCF data and when error found - delete temp and target files (maybe special switch to leave corrupted target needed).
Both points are valid. There should be:
- A checksum of the original file to check if recompression was successful
- (At least in -cn mode) A checksum of the .pcf file
- Deleted temporary files (in this case and when errors occured in general)
Delete of partial output file is very important too. User may not see error and think file is OK. Maybe create file with tempname and only after successful recover rename it to needed name?