Paths in ZIP

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
May 20, 2008
425
2
#1
Given a list file, files.lst, of:

file.txt
sub\file.txt

and the command:

zip /a files.zip @file.lst

I would expect the resulting zip to have two files, one in a subfolder path. Instead, what happens is:

<= file.txt
<= sub\file.txt
TCC: Error in archive D:\temp\files.zip :
File already exists in the archive. "sub\file.txt"

Shouldn't this be equivalent to the infozip command:
zip.exe [email protected] files.zip < files.lst

That does create a zip with two files, one in a path.

Or, is there another way to do this with the internal ZIP so that paths are created in the ZIP and duplicate names in subfolders do not cause errors?

I'm using a file list instead of /R because I do not want to automatically include nested sub folders with names like Debug and Release, which may exist under the current folder or under some nested folder.

TCC 12.00.42 Win XP
 

rconn

Administrator
Staff member
May 14, 2008
10,292
90
#2
Given a list file, files.lst, of:

file.txt
sub\file.txt

and the command:

zip /a files.zip @file.lst

I would expect the resulting zip to have two files, one in a subfolder path. Instead, what happens is:

<= file.txt
<= sub\file.txt
TCC: Error in archive D:\temp\files.zip :
File already exists in the archive. "sub\file.txt"
WAD. Specifying the same filename twice isn't equivalent to implying a /R for the second file.

Shouldn't this be equivalent to the infozip command:
zip.exe [email protected] files.zip < files.lst
No.

Or, is there another way to do this with the internal ZIP so that paths are created in the ZIP and duplicate names in subfolders do not cause errors?
No.

Use InfoZip -- the internal ZIP isn't intended to emulate every obscure option of every ZIP / UNZIP app out there. (Besides then rendering it incompatible with every *other* ZIP / UNZIP app, the size & development time costs aren't justifiable.)