Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a file table, or inode structure (like in filesystems) of a zip or tar file?

share|improve this question
up vote 2 down vote accepted

No. Both tar and zip formats are designed so you can add files onto the end. Individual files or directories are added as contiguous header + data segments. There is no filesystem that allocates blocks to files in a non-contiguous fashion.

Tar files have no directory mechanism. Each tar header tells the file name, mode bits, userid and groupid, timestamp and filesize of the data segment that follows. End of the tar archive is marked by a null header. The way to know what's in a tar file is to read it, though if it's on disk, you can jump from one header to the next by seeking over the data segments.

Zip files follow the same conceptual format of repeated header + data segments but add a directory onto the end.

Zip format

share|improve this answer
So to clarify, the header's info on the filesize dictates where the file ends and the next begins? And the central directory just dictates the offset on where the file begins? – agz Jan 20 '13 at 5:14
@agovizer The directory at the end is largely redundant of the information in the individual headers. The reason for it is to avoid having to scan the entire archive to find out what's in it, as has to be done with a tar file. – Nicole Hamilton Jan 20 '13 at 16:25

Your Answer


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.