par2 with directory support.

Want something added? Ask for it here.
Post Reply
e3m88
Newbie
Newbie
Posts: 2
Joined: August 17th, 2015, 7:30 pm

par2 with directory support.

Post by e3m88 »

On my linux machine I have the following par2 release: par2cmdline-0.4-tbb-20150503.tar.gz

It does support directory structure and rename/move files, just like multipar does it in windows, I just have to use the d<dir> option.

Code: Select all

Options:

  -b<n>  : Set the Block-Count
  -s<n>  : Set the Block-Size (Don't use both -b and -s)
  -r<n>  : Level of Redundancy (%)
  -c<n>  : Recovery block count (Don't use both -r and -c)
  -f<n>  : First Recovery-Block-Number
  -u     : Uniform recovery file sizes
  -l     : Limit size of recovery files (Don't use both -u and -l)
  -n<n>  : Number of recovery files (Don't use both -n and -l)
  -m<n>  : Memory (in MB) to use
  -v [-v]: Be more verbose
  -q [-q]: Be more quiet (-q -q gives silence)
  -z<n>  : Number of "Opening: <file>" messages when creating parity files (zero for no limit)
  -t<+<n>|0<n>|-<n>>: Threaded processing. The options are:
     -t+ to checksum and create/repair concurrently - uses all available logical CPUs - good for hard disk files - [default]
     -t0 to checksum serially but create/repair concurrently with all available logical CPUs - better for slow media such as CDs/DVDs
     -t- to checksum/create/repair serially - uses a single logical CPU - good for testing this program
     -t+n to checksum and create/repair concurrently - uses n logical CPUs (up to all of the available logical CPUs)
     -t0n to checksum serially but create/repair concurrently - uses n logical CPUs if n > 0, or all available CPUs minus n if n < 0
     -t-n to checksum and create/repair concurrently - uses available logical CPUs minus n, eg, -t-1 on a 6 CPU system will use up to 5 CPUs
  -d<dir>: root directory for paths to be put in par2 files OR root directory for files to repair from par2 files
  -0     : create dummy par2 files - for getting actual final par2 files sizes without doing any computing
  --     : Treat all remaining CommandLine as filenames
But my download machine is windows and your par2.exe doesn't have this option and it is very useful.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: par2 with directory support.

Post by shypike »

The -d option is also very dangerous from a security perspective.
It makes it possible for a poster to create a post that would overwrite important system files.
Depending on how well your system is secured, this could give a lot of problems.
SABnzbd chooses the safe solution to always create paths based on the unpack folder.
e3m88
Newbie
Newbie
Posts: 2
Joined: August 17th, 2015, 7:30 pm

Re: par2 with directory support.

Post by e3m88 »

Let me explain better.
For example I create par2 files from a directory and sub directories, I can't choose to go back in a folder so if I want to replace system files I would need to be already on a system folder. If I repair with multipar for example the files will be auto renamed and the folder structure repaired (subdirectories) from the current folder (par2 files + all files). I don't see how this is diferent than extracting a winrar archive on a folder, it recreates exactly the folder structure that you already have, you can only replace system files if you already are in a system folder. The par2 file doesn't choose the root folder when is repairing, only when is creating a folder structure.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: par2 with directory support.

Post by shypike »

As we cannot always know which par2 is installed, just passing -d isn't possible.
An option would be to enable the "extra parameter" box for Linux/Unix systems too.
I'll look into this further.
Post Reply