[28714] | 1 | p7zip 9.20.1
|
---|
| 2 | ==========
|
---|
| 3 |
|
---|
| 4 | Homepage : http://p7zip.sourceforge.net/
|
---|
| 5 |
|
---|
| 6 | p7zip is a port of the Windows programs 7z.exe and 7za.exe provided by 7-zip.
|
---|
| 7 |
|
---|
| 8 | 7-zip is a file archiver with the highest compression ratio.
|
---|
| 9 | Homepage : www.7-zip.org
|
---|
| 10 |
|
---|
| 11 | 7z uses plugins (7z.so and Codecs/Rar29.so) to handle archives.
|
---|
| 12 | 7za is a stand-alone executable.
|
---|
| 13 | 7za handles less archive formats than 7z.exe.
|
---|
| 14 | 7zr is a light stand-alone executable that supports only 7z/LZMA/BCJ/BCJ2.
|
---|
| 15 |
|
---|
| 16 | NEW:
|
---|
| 17 | 7zG : see GUI/readme.txt
|
---|
| 18 |
|
---|
| 19 | CAUTION :
|
---|
| 20 | ---------
|
---|
| 21 |
|
---|
| 22 | - FIRST : DO NOT USE the 7-zip format for backup purpose on Linux/Unix because :
|
---|
| 23 | - 7-zip does not store the owner/group of the file
|
---|
| 24 |
|
---|
| 25 | On Linux/Unix, in order to backup directories you must use tar !
|
---|
| 26 | to backup a directory : tar cf - directory | 7za a -si directory.tar.7z
|
---|
| 27 | to restore your backup : 7za x -so directory.tar.7z | tar xf -
|
---|
| 28 |
|
---|
| 29 | - if you want to send files and directories (not the owner of file)
|
---|
| 30 | to others Unix/MacOS/Windows users, you can use the 7-zip format.
|
---|
| 31 |
|
---|
| 32 | example : 7za a directory.7z directory
|
---|
| 33 |
|
---|
| 34 | do not use "-r" because this flag does not do what you think
|
---|
| 35 | do not use directory/* because of ".*" files
|
---|
| 36 | (example : "directory/*" does not match "directory/.profile")
|
---|
| 37 |
|
---|
| 38 |
|
---|
| 39 | BUILD :
|
---|
| 40 | -------
|
---|
| 41 |
|
---|
| 42 | If you have downloaded the "bin" package,
|
---|
| 43 | use directly the program bin/7za.
|
---|
| 44 | (tested on Redhat 9.0, Fedora 2, Mandrake 10.0, Debian 3.0)
|
---|
| 45 | As the program is statically linked, its should run on many x86 or amd64 linux.
|
---|
| 46 |
|
---|
| 47 | If you have downloaded the "source" package,
|
---|
| 48 |
|
---|
| 49 | According to your OS, copy makefile.linux,
|
---|
| 50 | makefile.freebsd, makefile.cygwin, ...
|
---|
| 51 | over makefile.machine
|
---|
| 52 |
|
---|
| 53 | Example : building 7za, 7z (with its plugins), 7zr and Client7z and passing the internal tests
|
---|
| 54 | cp makefile.linux_x86_asm_gcc_4 makefile.linux
|
---|
| 55 | make all_test
|
---|
| 56 |
|
---|
| 57 |
|
---|
| 58 | If you want to make a parallel build on a 4 cpu machine : make -j 4 TARGET
|
---|
| 59 |
|
---|
| 60 | If you have trouble, try : make -f makefile.oldmake TARGET
|
---|
| 61 |
|
---|
| 62 | make depend : to rebuild the makefile.depend
|
---|
| 63 | make clean : to clean all directories
|
---|
| 64 | make : to build bin/7za
|
---|
| 65 | make sfx : to build bin/7zCon.sfx (7za can now create SFX archive)
|
---|
| 66 | make 7z : to build bin/7z and its plugins :
|
---|
| 67 | - "bin/7z.so" (GNU LGPL + AES code license)
|
---|
| 68 | - "bin/Codecs/Rar29.so" (GNU LGPL + unRAR restriction)
|
---|
| 69 | make 7zr : to build bin/7zr
|
---|
| 70 | make all : to build bin/7za and bin/7zCon.sfx
|
---|
| 71 | make all2 : to build bin/7za, bin/7z (with its plugins) and bin/7zCon.sfx
|
---|
| 72 | make all3 : to build bin/7za, bin/7z (with its plugins), bin/7zr and bin/7zCon.sfx
|
---|
| 73 | make test : to test bin/7za (extracting, archiving, password ...)
|
---|
| 74 | make test_7z : to test bin/7z (extracting, archiving, password ...)
|
---|
| 75 | make test_7zr : to test bin/7zr (extracting, archiving, ...)
|
---|
| 76 |
|
---|
| 77 | make 7zG : to build bin/7zG and its plugins :
|
---|
| 78 | - "bin/7z.so" (GNU LGPL + AES code license)
|
---|
| 79 | - "bin/Codecs/Rar29.so" (GNU LGPL + unRAR restriction)
|
---|
| 80 | make test_7zG : to test bin/7zG (extracting, archiving, ...)
|
---|
| 81 |
|
---|
| 82 |
|
---|
| 83 | this procedure has been tested on :
|
---|
| 84 | - x86 CPU :
|
---|
| 85 | Linux - Debian 3.0 Stable
|
---|
| 86 | Linux - Ubuntu 10.10
|
---|
| 87 | MacOS 10.6.6
|
---|
| 88 |
|
---|
| 89 | - AMD64 CPU :
|
---|
| 90 | Linux - Ubuntu 10.10
|
---|
| 91 | MacOS 10.6.6
|
---|
| 92 |
|
---|
| 93 | - sparc CPU :
|
---|
| 94 | Solaris 8 (sparc) with gcc 2.95.2
|
---|
| 95 |
|
---|
| 96 | - powerpc CPU :
|
---|
| 97 | MacOS X 10.4 (ppc)
|
---|
| 98 |
|
---|
| 99 | Some older versions of p7zip were tested :
|
---|
| 100 | - x86 CPU :
|
---|
| 101 | DOS - (built with DJGPP, see http://blairdude.googlepages.com/p7zip )
|
---|
| 102 | Linux - Redhat 9.0 Standart
|
---|
| 103 | Linux - Fedora 2 (Redhat) (gcc 3.3.3 and gcc-3.4.1 with
|
---|
| 104 | stack-smashing protector from www.trl.ibm.com/projects/security/ssp/)
|
---|
| 105 | Linux - Mandrake 10.0 Official
|
---|
| 106 | Linux - Ubuntu 8.04
|
---|
| 107 | FreeBSD 5.2.1 (gcc 3.3.3)
|
---|
| 108 | MacOS 10.4.8
|
---|
| 109 | NetBSD
|
---|
| 110 | CYGWIN_NT-5.1 1.5.9(0.112/4/2) 2004-03-18 23:05 i686 Cygwin
|
---|
| 111 | Solaris 9 (x86) with gcc 3.3.2
|
---|
| 112 | Solaris 10 (x86)
|
---|
| 113 |
|
---|
| 114 | - alpha CPU :
|
---|
| 115 | Linux - Debian 3.0 (alpha) with gcc 2.95.4
|
---|
| 116 |
|
---|
| 117 | - AMD64 CPU :
|
---|
| 118 | Linux - SuSE 8 ES (AMD64 Opteron) with gcc 3.2.2
|
---|
| 119 | Linux - Fedora 4 (AMD64 Turion) with gcc 4.0.1
|
---|
| 120 | Linux - Ubuntu 8.10
|
---|
| 121 |
|
---|
| 122 | - Itanium CPU :
|
---|
| 123 | HP-UX B.11.31 U ia64 with aCC (HP C/aC++ B3910B A.06.14 [Feb 22 2007])
|
---|
| 124 |
|
---|
| 125 | - s390x CPU :
|
---|
| 126 | Linux - SUSE Enterprise Linux 10 - with gcc 4.1.2
|
---|
| 127 | ( only the 32bits built works, the 64bits built does not pass the tests )
|
---|
| 128 |
|
---|
| 129 | - sparc CPU :
|
---|
| 130 | Solaris 9 (sparc) with gcc 3.3.2
|
---|
| 131 |
|
---|
| 132 | - powerpc CPU :
|
---|
| 133 | MacOS X 10.1/darwin 5.5 with gcc 932.1 (gcc 2.95.2)
|
---|
| 134 | MacOS X 10.3 with XCode 1.5
|
---|
| 135 |
|
---|
| 136 | - openpower CPU :
|
---|
| 137 | Linux openpower-linux1 2.6.5-7.97-pseries64 (ppc64) with gcc 3.3.3
|
---|
| 138 |
|
---|
| 139 | - IBM :
|
---|
| 140 | AIX 5.3 with gcc 4.1.0
|
---|
| 141 |
|
---|
| 142 | - Tru64 :
|
---|
| 143 | OSF 5.1 with gcc 3.4.2
|
---|
| 144 |
|
---|
| 145 | - PA-RISC :
|
---|
| 146 | HP-UX 11.11 with aCC (HP ANSI C++ B3910B A.03.73)
|
---|
| 147 | HP-UX 11.11 with gcc 3.4.2 (7za and 7zr : OK, 7z : failed because of a buggy gcc for HP-UX,
|
---|
| 148 | plugins don't work because C++ constructors are not called !)
|
---|
| 149 |
|
---|
| 150 |
|
---|
| 151 | BUILD with cmake
|
---|
| 152 | ----------------
|
---|
| 153 | You can only build 7za.
|
---|
| 154 |
|
---|
| 155 | cd CPP/7zip/CMAKE
|
---|
| 156 |
|
---|
| 157 | edit generate.sh to choose your target
|
---|
| 158 |
|
---|
| 159 | ./generate.sh
|
---|
| 160 |
|
---|
| 161 | the cmake project for the target is in "CPP/7zip/CMAKE/Alone".
|
---|
| 162 |
|
---|
| 163 | For the target "Unix Makefiles", use "make" to compile
|
---|
| 164 |
|
---|
| 165 | For others target, use the IDE (CodeBlocks, KDevelop3, Eclipse CDT4)
|
---|
| 166 |
|
---|
| 167 | INSTALL :
|
---|
| 168 | ---------
|
---|
| 169 |
|
---|
| 170 | method 1
|
---|
| 171 | --------
|
---|
| 172 | - edit install.sh to change DEST_HOME
|
---|
| 173 | - ./install.sh : to install
|
---|
| 174 | Remark : you must be "root" to install 7za in the directory "/usr/local"
|
---|
| 175 |
|
---|
| 176 | method 2
|
---|
| 177 | --------
|
---|
| 178 | - 7za is a stand-alone program, you can put this program where you want.
|
---|
| 179 | example : cp bin/7za /usr/local/bin/7za
|
---|
| 180 |
|
---|
| 181 | - 7z needs its plugins. You must copy the file 7z, 7z.so
|
---|
| 182 | and the directory Codecs in the same destination directory.
|
---|
| 183 |
|
---|
| 184 | - if you want to be able to create SFX archive, copy bin/7zCon.sfx
|
---|
| 185 | to the directory where 7za or 7z can be found.
|
---|
| 186 |
|
---|
| 187 |
|
---|
| 188 | USAGE:
|
---|
| 189 | ------
|
---|
| 190 | Remark : you can replace 7za with 7z.
|
---|
| 191 |
|
---|
| 192 | 7za t archive.7z : tests files in the archive archive.7z
|
---|
| 193 | 7za l archive.7z : lists all files from archive archive.7z
|
---|
| 194 | 7za x archive.7z : extracts all files from archive archive.7z
|
---|
| 195 | to the current directory
|
---|
| 196 |
|
---|
| 197 | 7za a archive.7z file1 fileN : add files to the archive archive.7z
|
---|
| 198 |
|
---|
| 199 | 7za a archive.7z dir1 : add all files and subdirectories from directory "dir1" to archive archive.7z
|
---|
| 200 |
|
---|
| 201 | CAUTION : do not use the flag "-r" unless you know what you are doing ...
|
---|
| 202 |
|
---|
| 203 | 7za a -sfx archive.exe dir1 : add all files from directory "dir1" to SFX archive archive.exe
|
---|
| 204 | (Remark : SFX archive MUST end with ".exe")
|
---|
| 205 |
|
---|
| 206 | You can also add or extract files to/from .zip or .tar archives.
|
---|
| 207 | You can also compress/uncompress .gz or .bz2 files.
|
---|
| 208 |
|
---|
| 209 | 7za a -tzip archive.zip file file2 file3
|
---|
| 210 | 7za a -ttar archive.tar file
|
---|
| 211 | 7za a -tgzip file.gz file
|
---|
| 212 | 7za a -tbzip2 archive.bz2 file
|
---|
| 213 |
|
---|
| 214 | You can use password for archives:
|
---|
| 215 | 7za a -pmy_password archive.7z dir1
|
---|
| 216 |
|
---|
| 217 | For .7z archive only, you can enable archive header encryption with "-mhe"
|
---|
| 218 | 7za a -mhe=on -pmy_password archive.7z dir1
|
---|
| 219 |
|
---|
| 220 | For more, see the documentation of 7za.exe in DOCS/MANUAL directory
|
---|
| 221 | 7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on archive.7z dir1
|
---|
| 222 | adds all files from directory "dir1" to archive archive.7z
|
---|
| 223 | using "ultra settings".
|
---|
| 224 | -t7z : 7z archive
|
---|
| 225 | -m0=lzma : lzma method
|
---|
| 226 | -mx=9 : level of compression = 9 (Ultra)
|
---|
| 227 | -mfb=64 : number of fast bytes for LZMA = 64
|
---|
| 228 | -md=32m : dictionary size = 32 megabytes
|
---|
| 229 | -ms=on : solid archive = on
|
---|
| 230 |
|
---|
| 231 | To use the new codec "lzma2"
|
---|
| 232 | 7za a -m0=lzma2 archive.7z directory
|
---|
| 233 |
|
---|
| 234 |
|
---|
| 235 | BENCHMARKS :
|
---|
| 236 | ------------
|
---|
| 237 | 7za b : bench LZMA codec
|
---|
| 238 | 7z b -mm=crc : make internal crc check.
|
---|
| 239 |
|
---|
| 240 |
|
---|
| 241 | hugetlbfs (large pages)
|
---|
| 242 | ------------
|
---|
| 243 |
|
---|
| 244 | Using huges pages in Linux requires some preparations.
|
---|
| 245 | First, make sure your running kernel has support for hugetlbfs compiled in:
|
---|
| 246 |
|
---|
| 247 | ~$ grep hugetlbfs /proc/filesystems
|
---|
| 248 | nodev hugetlbfs
|
---|
| 249 |
|
---|
| 250 | You can view your current huge page configuration like this:
|
---|
| 251 |
|
---|
| 252 | ~$ grep Huge /proc/meminfo
|
---|
| 253 | HugePages_Total: 0
|
---|
| 254 | HugePages_Free: 0
|
---|
| 255 | HugePages_Rsvd: 0
|
---|
| 256 | HugePages_Surp: 0
|
---|
| 257 | Hugepagesize: 2048 kB
|
---|
| 258 |
|
---|
| 259 | In this case the size of a huge page is 2 MiB.
|
---|
| 260 | So, if you have 2 GiB of RAM and want to reserve 512 MiB for huge pages,
|
---|
| 261 | you would need 256 pages.
|
---|
| 262 |
|
---|
| 263 | Do the following as root:
|
---|
| 264 |
|
---|
| 265 | ~# echo 296 >/proc/sys/vm/nr_hugepages
|
---|
| 266 | ~# grep Huge /proc/meminfo
|
---|
| 267 | HugePages_Total: 296
|
---|
| 268 | HugePages_Free: 296
|
---|
| 269 | HugePages_Rsvd: 0
|
---|
| 270 | HugePages_Surp: 0
|
---|
| 271 | Hugepagesize: 2048 kB
|
---|
| 272 |
|
---|
| 273 | Finally, make access from user space possible:
|
---|
| 274 |
|
---|
| 275 | ~# mkdir /hugepages
|
---|
| 276 | ~# mount -t hugetlbfs -o rw,nosuid,nodev,noexec,noatime none /hugepages
|
---|
| 277 | ~# chmod 1777 /hugepages
|
---|
| 278 |
|
---|
| 279 | Option 1 : Now huge pages are configured.
|
---|
| 280 | In your shell, set the environment variable HUGETLB_PATH to the mount point:
|
---|
| 281 | ~$ export HUGETLB_PATH=/hugepages
|
---|
| 282 | or
|
---|
| 283 |
|
---|
| 284 | Option 2 : Let p7zip find out the first directory with the type "hugetlbfs"
|
---|
| 285 |
|
---|
| 286 |
|
---|
| 287 | To enable huge page use in p7zip, pass the '-slp' switch to it.
|
---|
| 288 | Ex: 7za -slp a t.7z dir
|
---|
| 289 |
|
---|
| 290 |
|
---|
| 291 |
|
---|
| 292 | If you want this to be a permanent setup :
|
---|
| 293 | - mkdir /hugepages
|
---|
| 294 |
|
---|
| 295 | - add an entry to your /etc/fstab so that when you reboot your computer,
|
---|
| 296 | your hugetlbfs will mount automatically :
|
---|
| 297 | hugetlbfs /hugepages hugetlbfs rw,nosuid,nodev,noexec,noatime 0 0
|
---|
| 298 |
|
---|
| 299 | - add this in your /etc/rc.local :
|
---|
| 300 | chmod 1777 /hugepages
|
---|
| 301 | echo 296 > /proc/sys/vm/nr_hugepages
|
---|
| 302 |
|
---|
| 303 | optional : export HUGETLB_PATH=/hugepages
|
---|
| 304 |
|
---|
| 305 | To enable huge page use in p7zip, pass the '-slp' switch to it : 7za -slp b
|
---|
| 306 |
|
---|
| 307 |
|
---|
| 308 | Remark : with current CPU : "7za -slp b" is not faster than "7za b".
|
---|
| 309 | If you want to see some speedup, compress at least 300MB
|
---|
| 310 | Ex : 7za -slp -mx=9 -a big_file.tar.7z big_file.tar
|
---|
| 311 |
|
---|
| 312 |
|
---|
| 313 | LICENSE :
|
---|
| 314 | ---------
|
---|
| 315 | please read DOCS/License.txt.
|
---|
| 316 |
|
---|
| 317 | LIMITATIONS from 7-zip :
|
---|
| 318 | ------------------------
|
---|
| 319 |
|
---|
| 320 | - does not support uid/gid for the .tar format (so, use tar on Unix)
|
---|
| 321 |
|
---|
| 322 | LIMITATIONS for Unix version only :
|
---|
| 323 | -----------------------------------
|
---|
| 324 |
|
---|
| 325 | - can handle properly UNICODE filenames only if the environment is UTF-8.
|
---|
| 326 | Example : export LANG=en_US.UTF-8 ; unset LC_CTYPE
|
---|
| 327 | Remark : see the possible values for LANG in the directory
|
---|
| 328 | - /usr/lib/locale : Fedora 2 / Solaris 8
|
---|
| 329 | - /usr/share/locale : OpenBSD / Debian / FreeBSD / MacOS X / Mandrake 10.1 / NetBSD
|
---|
| 330 |
|
---|
| 331 | On Linux, to display the available locales : locale -a
|
---|
| 332 |
|
---|
| 333 | p7zip relies on LC_CTYPE and then on LANG to convert name to/from UNICODE.
|
---|
| 334 | the command "locale" should display these environment variables.
|
---|
| 335 | you can also do "echo $LC_CTYPE" and "echo $LANG".
|
---|
| 336 |
|
---|
| 337 | If you do not plan to export your archive, you can use the flag "-no-utf16".
|
---|
| 338 | Usage :
|
---|
| 339 | 7za a -no-utf16 archive.7z dirOrFile1 ... dirOrFileN
|
---|
| 340 | 7za t -no-utf16 archive.7z
|
---|
| 341 | 7za l -no-utf16 archive.7z
|
---|
| 342 | 7za x -no-utf16 archive.7z
|
---|
| 343 |
|
---|
| 344 | - ignores Windows file access permissions (files are created with default permissions)
|
---|
| 345 |
|
---|
| 346 | see also TODO file.
|
---|
| 347 |
|
---|
| 348 | DEVELOPPER CORNER:
|
---|
| 349 | ------------------
|
---|
| 350 |
|
---|
| 351 | - WaitForMultipleObject has no equivalence on Unix.
|
---|
| 352 | - Events don't exist.
|
---|
| 353 | - sizeof(wchar_t) = 4 with GCC (2 with MS VC++)
|
---|
| 354 | - "FIXME" in source code indicates that you should add codes to better handle all cases.
|
---|
| 355 |
|
---|
| 356 | - "FIXED" in source code indicates that the original code has been changed to work in Unix environment.
|
---|
| 357 |
|
---|
| 358 | see also TODO file.
|
---|