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
?": 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:
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?
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.
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.
.....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! :)
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.
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.
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.
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:
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.
Use -spf switch with 7-zip 9.30
-aou is senseless for "a" command
That works very nicely Igor, thank you!
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.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.