Paul Houle
--- GPL software---

[page last modified 9/28/2015]

Par2cmdline is GPL'd free software written by Peter Brian Clements.  It is a 32-bit command-line tool to create and utilize parity files for a set of source files, enabling one to repair the source files in case they are damaged, perhaps in transmission or due to the aging of some storage system.  The executable name of the original program is PAR2.EXE.

I've used PAR2 for quite some time to add parity files to backup sets prior to writing them to DVD.  This is a scripted process that runs entirely under DOS.  I use GHOST to generate the backup sets.

And yes... it's true you can run PAR2 under pure 16-bit DOS.  To do so you first need long file name support, since PAR2 writes only long name output files.  I have DOSLFN -- ver 0.40d -- loaded for this.   Finally you need a DOS extender that can run PAR2, and HX can.

So far so good, except for the speed.  PAR2 takes some time to generate, especially for large files, and the backup files in question are in the neighborhood of 2 gig.

In 2008 I took at look at the source and sped it up by adding an MMX assembly routine to the par2 creation process (the original C++ code is used if run on a non-MMX-capable processor). I also added logic to support multiple CPU cores.  Creation speed was the focus -- I create .par2 files often, but rarely verify using them (which is fast as it is), and practically never need to repair.

In 2010 a new MD5 routine was installed, specific to the X86 architecture.  This sped up creation and repair a bit (10%), and verification substantially (37%).  phpar2 verification is now 40% faster than the sourceforge par2.exe.

The current result?  On a Core 2 quad (4 cores) Q6600 -- to process a 1 gigabyte source file to create 5% par2 files:

    par2.exe (sourceforge)   234 secs
    QuickPar (0.9.1)         130 secs
    phpar2.exe                44 secs

So (on my computer) for creation phpar2 is over 5x faster than the par2.exe on sourceforge, and phpar2 is 3x faster than the Win32 QuickPar 0.9.1.   The repair process is also sped up, since it shares the use of the routine that has been hand-written in assembly.  Note: the assembly was tuned to Intel Core 2 micro-architecture.

Since I was in the code I also fixed a couple of longstanding bugs relating to very large (>2 gig) files, and a bug causing failures in "quiet" mode.

To add the enhanced routines required changing only a couple dozen lines of the existing C++ code -- so the overall change to the code base is minimal.

9/28/2015: A phpar2s.bat file is provided as a wrapper to phpar2.exe.   phpar2s provides sub-directory support; likely useless to most.   The phpar2s argument is a par2 operation (C, V, or R) and target directory.  Target sub-directory files are renamed into the target, a .par2 is created at the target directory level, and the source files are renamed back to their original locations.  .par2 data created with phpar2s must be be verified/restored with phpar2s.

Change Log

9/28/2015- phpar2 version 1.4.  Bug fix when generating multi-gigabyte .par2 output on systems with lots of RAM.  Suppress banner unless no operation is performed.  Added phpar2s.bat as a very simple workaround for lack of sub-directory support.

Click here to download .exe and .bat only

Click here to download .exe and full source

4/29/2010- phpar2 version 1.3.  New MD5 code -- creation is 10% faster, verification 37% faster (measured on an Intel Core 2 Quad).

Click here to download .exe only

Click here to download .exe and full source

3/22/2008- phpar2 version 1.2.  Sped up and simplified multi-core threading logic.

Click here to download .exe only

Click here to download .exe and full source

3/19/2008- phpar2 version 1.1.  Simple multi-core support logic added.

Click here to download .exe only

Click here to download .exe and full source

3/7/2008- phpar2 version 1.0.  Assembly language PAR2 creation routine.

Click here to download .exe only

Click here to download .exe and full source

Widget is loading comments...

You are visitor 64314      Go to Home Page