Switch -OI[-][:<minsize>] - save identical files as references


If this switch is specified, WinRAR analyzes the file contents before starting archiving. If several identical files are found, the first file in the set is saved as usual file and all following files are saved as references to this first file. It allows to reduce the archive size, but applies some restrictions to resulting archive. You must not delete or rename the first identical file in archive after the archive was created, because it will make extraction of following files using it as a reference impossible. If you modify the first file, following files will also have the modified contents after extracting.

While typically it is possible to unpack a reference without unpacking the first file, in some cases it might be necessary to involve the first file into extraction to create following files successfully. Such cases include a multivolume archive stored on several removable media and archives containing a very large number of references.

It is recommended to use -oi only if you compress a lot of identical files and will not modify an archive later. If all identical files are small enough to fit into compression dictionary specified with -md<size> switch, -s can provide more flexible solution than -oi.

Optional <minsize> value allows to define the minimum file size threshold. Files smaller than <minsize> are not analyzed and not considered as identical. If this parameter is not present, it is assumed to be 64 KB by default. Selecting too small <minsize> may increase the time required to detect identical files.

<minsize> can include an optional trailing unit type character. Unit type can be 'b' or 'B' for bytes, 'k' for kilobytes, 'K' for thousands of bytes, 'm' for megabytes, 'M' for millions of bytes, 'g' for gigabytes, 'G' for billions of bytes, 't' for terabytes, 'T' for trillions of bytes. If this character is not present, bytes are assumed.

Use -oi- if you wish to disable identical file processing enabled in WinRAR configuration.

This switch is the command line equivalent of Save identical files as references option in "Archive name and parameters" dialog.

Example

Save contents of current folder to archive.rar. Store identical files, larger than or equal to 1000000 bytes, as references.

WinRAR a -oi:1M archive