Parchive / par2cmdline

Official repo for par2cmdline and libpar2
http://parchive.sourceforge.net
GNU General Public License v2.0
724 stars 75 forks source link

How to detect wrong data files against par2 files? #122

Open lkydev opened 6 years ago

lkydev commented 6 years ago

Say there are two files in a directory:

test1.bin
test2.bin

I want to create par2 files for test1.bin, but suppose I make a mistake:

par2 create test1.bin.par2 test2.bin

Verification seems to be fine; command exit code is 0:

par2 verify test1.bin.par2 test1.bin

or even just

par2 verify test1.bin.par2

The only way to spot the error is to read the output closely. It says test2.bin was opened, not test1.bin.

Is there a better way to check that test1.bin is a wrong data file for the par2 file set?

Thanks.

lkydev commented 6 years ago

On second thoughts, it is easy enough.

Exclude the influence of other files (test2.bin) by the following:

mkdir /some/dest cp test1.bin.par2 /some/dest cp test1.bin /some/dest cd /some/dest par2 verify test1.bin.par2

Inspect the output of verification and see if it reports OK.