precomp-cpp icon indicating copy to clipboard operation
precomp-cpp copied to clipboard

Corrupted PCF behavior

Open pasha-zzz opened this issue 8 years ago • 2 comments

When PCF file is corrupted PreComp does... nothing!

  1. I change 1 byte in -cn PCF - recovered via -r file differs from original in 1 byte (one case, may be others);
  2. 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).

pasha-zzz avatar Sep 22 '17 16:09 pasha-zzz

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)

schnaader avatar Sep 22 '17 17:09 schnaader

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?

pasha-zzz avatar Sep 22 '17 17:09 pasha-zzz