Go to file
Lu zhiping 1ecbaf45b4 changed debian/source/format to native 2022-06-04 18:08:51 +08:00
Asm/x86 Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
C Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
CPP Fix g++ warning 2022-06-04 18:08:51 +08:00
DOC Remove references to fm/ dir and license.htm 2022-06-04 18:08:51 +08:00
GUI Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
Utils Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
check Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
contrib Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
debian changed debian/source/format to native 2022-06-04 18:08:51 +08:00
man1 Update man pages 2022-06-04 18:08:51 +08:00
ChangeLog Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
README Remove build instructions from README file 2022-06-04 18:08:51 +08:00
TODO Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
install.sh Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
install_local_context_menu.sh Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
last_error Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile Makefiles cleanup 2022-06-04 18:08:51 +08:00
makefile.afl Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.aix_gcc Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.android_arm Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.beos Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.common Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.crc32 Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.cygwin Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.cygwin64 Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.cygwin64_asm Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.cygwin_asm Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.cygwin_clang Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.cygwin_clang_asm Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.djgpp Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.djgpp_watt Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.freebsd5 Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.freebsd6+ Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.glb Hardening flags 2022-06-04 18:08:51 +08:00
makefile.gprof Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.haiku Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.hpux-acc Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.hpux-acc_64 Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.hpux-gcc Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_amd64 Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_amd64_asm Include linux makefile 2022-06-04 18:08:51 +08:00
makefile.linux_amd64_asm_icc Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_amd64_sanitizer Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_any_cpu Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_any_cpu_gcc_4.X Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_clang_amd64_asm Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_clang_amd64_asm_sanitize Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_cross_aarch64 Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_cross_arm Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_cross_djgpp Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_cross_m68k Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_cross_mipsel Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_cross_ppc Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_cross_ppc64 Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_cross_ppc64le Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_cross_s390x Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_cross_sparc64 Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_gcc6_sanitize Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_gcc_2.95_no_need_for_libstdc Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_other Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_s390x Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_scan-build Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_valgrind Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_x32 Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_x86_asm_gcc_4.X Include linux makefile 2022-06-04 18:08:51 +08:00
makefile.linux_x86_asm_gcc_4.X_fltk Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_x86_asm_gcc_mudflap_4.X Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_x86_asm_icc Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.linux_x86_icc Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.machine Include linux makefile 2022-06-04 18:08:51 +08:00
makefile.macosx_gcc_32bits Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.macosx_gcc_32bits_asm Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.macosx_gcc_32bits_ppc Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.macosx_gcc_64bits Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.macosx_llvm_64bits Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.netbsd Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.netware_asm_gcc_3.X Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.oldmake Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.openbsd Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.openbsd_no_port Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.qnx_shared.bin Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.qnx_shared.so Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.qnx_static Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.solaris_sparc_CC_32 Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.solaris_sparc_CC_64 Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.solaris_sparc_gcc Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.solaris_x86 Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00
makefile.tru64 Import Upstream version 16.02+dfsg 2022-06-04 18:08:45 +08:00

README

    p7zip 16.02
    ===========

Homepage : http://p7zip.sourceforge.net/

p7zip is a port of the Windows programs 7z.exe and 7za.exe provided by 7-zip.

7-zip is a file archiver with the highest compression ratio.
Homepage : www.7-zip.org

  7z uses plugins (7z.so and Codecs/Rar.so) to handle archives.
  7za is a stand-alone executable (7za handles less archive formats than 7z).
  7zr is a light stand-alone executable that supports only 7z/LZMA/BCJ/BCJ2.

  Some GUI :
    7zG  : beta  stage
    7zFM : alpha stage

CAUTION :
---------

- FIRST : DO NOT USE the 7-zip format for backup purpose on Linux/Unix because :
  - 7-zip does not store the owner/group of the file

  On Linux/Unix, in order to backup directories you must use tar !
  to backup a directory  : tar cf - directory | 7za a -si directory.tar.7z
  to restore your backup : 7za x -so directory.tar.7z | tar xf -

- if you want to send files and directories (not the owner of file)
  to others Unix/MacOS/Windows users, you can use the 7-zip format.

  example : 7za a directory.7z  directory

  do not use "-r" because this flag does not do what you think
  do not use "directory/*" because of ".*" files
   (example : "directory/*" does not match "directory/.profile")

USAGE:
------
  Remark : you can replace 7za with 7z.

  7za t archive.7z  : tests files in the archive archive.7z
  7za l archive.7z  : lists all files from archive archive.7z
  7za x archive.7z  : extracts all files from archive archive.7z
                   to the current directory

  7za a archive.7z file1 fileN : add files to the archive archive.7z

  7za a archive.7z  dir1 :  add all files and subdirectories from directory "dir1" to archive archive.7z

  CAUTION : do not use the flag "-r" unless you know what you are doing ...

  7za a -sfx archive.x dir1 : add all files from directory "dir1" to SFX archive archive.x

  You can also add or extract files to/from .zip or .tar archives.
  You can also compress/uncompress .gz or .bz2 files.

  7za a -tzip   archive.zip file file2 file3
  7za a -ttar   archive.tar file
  7za a -tgzip  file.gz     file
  7za a -tbzip2 archive.bz2 file

  You can use password for archives:
  7za a -pmy_password archive.7z  dir1

  For .7z archive only, you can enable archive header encryption with "-mhe"
  7za a -mhe=on -pmy_password archive.7z  dir1

  For more, see the documentation of 7za.exe in DOC/MANUAL directory
  7za a -t7z  -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on archive.7z  dir1
      adds all files from directory "dir1" to archive archive.7z
      using "ultra settings".
      -t7z     : 7z archive
      -m0=lzma : lzma method
      -mx=9    : level of compression = 9 (Ultra)
      -mfb=64  : number of fast bytes for LZMA = 64
      -md=32m  : dictionary size = 32 megabytes
      -ms=on   : solid archive = on

  To use the new codec "lzma2"
  7za a -m0=lzma2 archive.7z directory


BENCHMARKS :
------------
  7za b : bench LZMA codec
  7z b -mm=crc : make internal crc check.
  7za b "-mm=*" : test all methods



hugetlbfs (large pages) :
-------------------------

  Using huges pages in Linux requires some preparations.
  First, make sure your running kernel has support for hugetlbfs compiled in:

  ~$ grep hugetlbfs /proc/filesystems
  nodev       hugetlbfs

  You can view your current huge page configuration like this:

  ~$ grep Huge /proc/meminfo
  HugePages_Total:       0
  HugePages_Free:        0
  HugePages_Rsvd:        0
  HugePages_Surp:        0
  Hugepagesize:       2048 kB

  In this case the size of a huge page is 2 MiB.
  So, if you have 2 GiB of RAM and want to reserve 512 MiB for huge pages,
  you would need 256 pages.

  Do the following as root:

  ~# echo 296 >/proc/sys/vm/nr_hugepages
  ~# grep Huge /proc/meminfo
  HugePages_Total:     296
  HugePages_Free:      296
  HugePages_Rsvd:        0
  HugePages_Surp:        0
  Hugepagesize:       2048 kB

  Finally, make access from user space possible:

  ~# mkdir /hugepages
  ~# mount -t hugetlbfs -o rw,nosuid,nodev,noexec,noatime none /hugepages
  ~# chmod 1777 /hugepages

  Option 1 : Now huge pages are configured.
           In your shell, set the environment variable HUGETLB_PATH to the mount point:
           ~$ export HUGETLB_PATH=/hugepages
  or

  Option 2 : Let p7zip find out the first directory with the type "hugetlbfs"


  To enable huge page use in p7zip, pass the '-slp' switch to it.
  Ex: 7za -slp a t.7z dir



  If you want this to be a permanent setup :
  - mkdir /hugepages

  - add an entry to your /etc/fstab so that when you reboot your computer,
    your hugetlbfs will mount automatically :
    hugetlbfs       /hugepages  hugetlbfs     rw,nosuid,nodev,noexec,noatime   0 0

  - add this in your /etc/rc.local :
    chmod 1777 /hugepages
    echo 296 >  /proc/sys/vm/nr_hugepages

  optional : export HUGETLB_PATH=/hugepages

  To enable huge page use in p7zip, pass the '-slp' switch to it : 7za -slp b


  Remark : with current CPU : "7za -slp b" is not faster than "7za b".
           If you want to see some speedup, compress at least 300MB
           Ex : 7za -slp -mx=9 -a big_file.tar.7z  big_file.tar


LICENSE :
---------
  please read copyright file.

LIMITATIONS from 7-zip :
------------------------

  - does not support uid/gid for the .tar format (so, use tar on Unix)

LIMITATIONS for Unix version only :
-----------------------------------

  - can handle properly UNICODE filenames only if the environment is UTF-8.
  Example : export LANG=en_US.UTF-8 ; unset LC_CTYPE
  Remark  : see the possible values for LANG in the directory
            - /usr/lib/locale   : Fedora 2 / Solaris 8
            - /usr/share/locale : OpenBSD / Debian / FreeBSD / MacOS X / Mandrake 10.1 / NetBSD

    On Linux, to display the available locales : locale -a

  p7zip relies on LC_CTYPE and then on LANG to convert name to/from UNICODE.
  the command "locale" should display these environment variables.
  you can also do "echo $LC_CTYPE" and "echo $LANG".

  If you do not plan to export your archive, you can use the flag "-no-utf16".
  Usage :
    7za a -no-utf16 archive.7z dirOrFile1 ... dirOrFileN
    7za t -no-utf16 archive.7z
    7za l -no-utf16 archive.7z
    7za x -no-utf16 archive.7z

  - ignores Windows file access permissions (files are created with default permissions)

  see also TODO file.

DEVELOPPER CORNER:
------------------

  - static analysis with cppcheck
    make cppcheck

  - static analysis with clang
    scan-build make all4 2>&1 | tee -i scan-build.out

  - dynamic analysis : valgrind
    cp makefile.linux_valgrind makefile.machine
    make test
    
  - dynamic analysis : gcc sanitize
    cp makefile.linux_amd64_sanitizer makefile.machine
    make test

  - WaitForMultipleObject has no equivalence on Unix.
  - Events don't exist.
  - sizeof(wchar_t) = 4 with GCC (2 with MS VC++)
  - "FIXME" in source code indicates that you should add codes to better handle all cases.

  - "FIXED" in source code indicates that the original code has been changed to work in Unix environment.

  see also TODO file.