Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm extracting a zip (self-extracting, but that probably doesn't matter) and for a few files I'm getting a dialog asking me if I want to replace a file that was already extracted with a file that's just about to be extracted. At first glance I didn't understand how a zip could contain the same file in the same place more than once. I then browsed to the file in question using 7zip (or any tool) and found this:

enter image description here

The difference is in the block number. What's actually happening here?

share|improve this question

4 Answers 4

Yes, the ZIP file format allows multiple files with the same name. Files in a zip aren't actually in directories but simply have a long name that includes the path. And files are added to the ZIP by effectively concatenating them end to end. The only place where synonyms cause a problem in the ZIP format is with the directory, where presumably the later file replaces the earlier one. But when an entire ZIP file is extracted (vs extracting individual files) the general approach is to ignore the directory and just extract the files in the order they appear in the ZIP.

The image shown is, of course, of the ZIP file contents, not a Windows directory.

share|improve this answer

Yes. .zip files CAN contain the same file twice. This can be accomplished using the "add to archive" function of your zip tool. By default, a later file overwrites any former file(s) when extracting as this is usually the desired behavior.

Also, files that differ only by the case of their filename/path are considered identical when extracting to a filesystem that is case insensitive (Windows or Mac OS.)

share|improve this answer

You can't have two identical file names in the same path. Have you checked to see if your system is hiding the extensions? That could be the possible difference between the two. Maybe one is a backup file.

share|improve this answer
    
Same file (with extension, which happens to be blank) same path. Please see the screenshot flickr.com/photos/46007162@N03/5278220416 - it shows the same file but as two different blocks. I am not sure what that means. –  Howiecamp Dec 20 '10 at 19:39

Looks like you are using Windows which considered two files with names differing by case alone to be the same filename.

It may be that your archive was created on a case-sensitive file-system (such as most Linux ones) and the two files had different cases (Ex: ENTRIES, Entries, entries).

If you look at the output, the files have the same size, same date, same CRC, so these file are identical, you can safely overwrite one with the other. It may be that some copied it with a different case as a local temporary backup while working on those files. The block number is that they are stored in different locations in the zip file, which should be obvious.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.