cannot get 7za.exe to work with a file list

Help
Chris
2013-08-30
2013-09-02
  • Chris

    Chris - 2013-08-30

    The command line output:

    C:\7zip>7za a -tzip c:\my_files.zip @c:\list.txt

    7-Zip (A) 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18

    Scanning

    ?": WARNING: The filename, directory name, or volume label syntax is incorrect.

    Updating archive c:\my_files.zip

    WARNINGS for files:

    ?" : The filename, directory name, or volume label syntax is incorrect.


    WARNING: Cannot find 1 file

    Contents of list.txt:
    "C:\MyTemp\Folder02\Text Document_201.txt"
    "C:\MyTemp\Folder02\Text Document_202.txt"
    "C:\MyTemp\Folder02\Text Document_203.txt"
    "C:\MyTemp\Folder02\Text Document_204.txt"
    "C:\MyTemp\Folder02\Text Document_205.txt"
    "C:\MyTemp\Folder02\Tmp Document201.tmp"
    "C:\MyTemp\Folder02\Tmp Document202.tmp"
    "C:\MyTemp\Folder02\Tmp Document203.tmp"
    "C:\MyTemp\Folder04\SubSubFolder04\Image_SS401.png"
    "C:\MyTemp\Folder04\SubSubFolder04\Image_SS403.png"
    "C:\MyTemp\Folder04\SubSubFolder04\Image_SS406.png"
    "C:\MyTemp\Folder04\SubSubFolder04\Text Document_SS402.txt"
    "C:\MyTemp\Folder04\SubSubFolder04\Text Document_SS403.txt"
    "C:\MyTemp\Folder04\SubSubFolder04\Text Document_SS404.txt"
    "C:\MyTemp\Folder04\SubSubFolder04\Text Document_SS405.txt"
    "C:\MyTemp\Folder04\SubSubFolder04\Tmp Document_SS402.tmp"
    "C:\MyTemp\Folder04\SubSubFolder04\Tmp Document_SS404.tmp"
    "C:\MyTemp\Folder04\SubSubFolder04\Tmp Document_SS406.tmp"


    my_files.zip is created, but 7za is unhappy with the list file. I have tried all sorts of variations on the theme such as putting the list file in the same directory as 7za:
    C:\7zip>7za a -tzip "c:\my_files.zip" @list.txt
    ....but the best result thus far is an empty zip file.

    What am I doing wrong?

     
  • Igor Pavlov

    Igor Pavlov - 2013-08-30

    Maybe there is some error in list file.
    Try to remove half of lines. Then remove half of lines again and so on.

    Also note that listfile can work without quotes.

     
  • Chris

    Chris - 2013-08-30

    Hello Igor

    The list is produced programatically, so the paths are accurate. Anyway, I cut it right down to the first two files, no quotes, same issue. Tried it with another list, two files right on drive C:\, newly created, 193KB each, still failed with/without quotes.

    C:\Part004.stl
    C:\Part005.stl

    .....Ah, the list file is a unicode (UTF8) file. If I change it to plain old ASCII, it works. So, it seems the issue is that the ZIP format does not like Unicode - if instead I make a 7z archive, that works fine with a UTF8 file. Solved! :)

     
  • Igor Pavlov

    Igor Pavlov - 2013-08-30

    There is no difference between zip and 7z for list file.
    So check it again.
    Create smallest list file (with just one name).
    Check it again.
    And look list file in hex editor.

     
    Last edit: Igor Pavlov 2013-08-30
  • Chris

    Chris - 2013-08-31

    I understand that, but if the content of the list is "paths in unicode", that is a problem for zip isn't it? I now can't make a list file that fails, which is good.

     
  • Igor Pavlov

    Igor Pavlov - 2013-08-31

    There is no problem with unicode. ZIP format supports UTF-8 encoding.
    I still don't understand about that error with listfile in your case.

     
  • Chris

    Chris - 2013-08-31

    Ah, I was misinformed then. I was led to believe that ZIP did not properly support UTF8. Certainly a lot of my colleagues in Japan/China think that is the case. Still, 7z seems to be better than zip anyway.

    I have a couple of other difficulties using a list file

    1) Across a range of paths, there are several files that do not have a name, just an extension. 7zip halts with an error message:
    Error:
    Duplicate filename:
    .NoDartCoverage
    .NoDartCoverage

    Even when using the -aou flag: 7za a -tz7z -aou -ssc c:\my_files.zip @c:\list.txt

    2) The list file contains file names with full paths. For each directory, only certain files are archived, not the entire directory contents, so using a list file is excellent. I'd like 7zip to store the full paths so that the directory structure is used when the files are extracted - but I can't figure out how to do that.

     
  • Igor Pavlov

    Igor Pavlov - 2013-09-01

    Use -spf switch with 7-zip 9.30
    -aou is senseless for "a" command

     
  • Chris

    Chris - 2013-09-01

    That works very nicely Igor, thank you!

     
  • Chris

    Chris - 2013-09-02

    Tested 1.36GB archived/extracted, all looking good.

    Actually, -aou for "a" command does make sense, because several large archive ops can be left to chug away unattended. You do not want a process to be stopped by file duplication being reported as an error - better that the files are given a postfix and that this is reported as a warning.

     

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

Sign up for the SourceForge newsletter:





No, thanks