#122 Won't add all files of a certain type


I've been using latest version of p7zip (9.20.1) on CentOS 5.6, and the following command does not seem to work as expected:

7za a php.7z *.php -r

I would want it to gather all PHP files while keeping the directory structure, but only very few of those file are actually in the archive created, with no error reported at all. Here is the generated output, if it can be useful:

7-Zip (A) 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=it_IT.UTF-8,Utf16=on,HugeFiles=on,4 CPUs)


Updating archive php.7z

Compressing check_login.php
Compressing manuale_generale/index.php
Compressing manuale_moduli_opzionali/index.php
Compressing index.php
Compressing index___.php

Everything is Ok

As you see, only 5 files where added, while there are about 100. If I try the same command using the windows version of 7z, all works fine.


  • Igor Pavlov

    Igor Pavlov - 2011-08-22

    try the command
    7za a all.7z -r
    if it works OK, show the files in all.7z that were not included to php.7z

  • Matteo Tassinari

    here are the files that were not included in the archive but were in the test archive I created following @ipavlov instructions:

    Compressing common/class.phpmailer.php
    Compressing common/common.php
    Compressing common/common_mail.php
    Compressing common/config.php
    Compressing common/mysql.class.php
    Compressing test/php/test.php

    it seems I made a mistake, I thought there were many more PHP file, while they're only 11, but if I try to archive only those I get only 5 in the archive.

    I've also checked read/write permissions and they are 0777 for all files, and I'm acting as root.

  • my p7zip

    my p7zip - 2011-08-22

    Unix shell interpretes itself the "*" character.

    I think that you wanted this command :

    7za a php.7z "*.php" -r

    Use the quotation mark to pass the "*" to the program.

  • Matteo Tassinari

    Why does it work correctly on the windows' console? Doesn't it parse the "*" character too?

    I'll try the suggested command and see if it works.

  • Matteo Tassinari

    Tested with the suggested command using the quotation marks, all worked properly, thank you and sorry for reportings what actually wasn't a bug.

  • Matteo Tassinari

    • status: open --> closed-works-for-me
  • my p7zip

    my p7zip - 2011-08-24

    > Why does it work correctly on the windows' console?
    The Windows' console does not try to interpret the parameters, so each Windows Console program must expand itself the "*" character ...


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks