Comment by thaumasiotes

12 days ago

> It effectively reduces the I/O, while unlike TAR, allowing direct random to the files without "extracting" them or seeking through the entire file

How do you access a particular file without seeking through the entire file? You can't know where anything is without first seeking through the whole file.

At the end of the ZIP file, there's a central directory of all files contained in that archive. Read the last block, seek to the block containing the file you want to access, done

  • > At the end of the ZIP file, there's a central directory of all files contained in that archive.

    Where does that begin?

    > Read the last block

    You mean the last 4KB chunk defined by the file system, or what? The comment can be up to 64KB long.

    • > You mean the last 4KB chunk defined by the file system, or what? The comment can be up to 64KB long.

      Okay, the last 65KB.

      Are you nitpicking now that you learned about the directory, or did you know about it before your first comment and pretended not to for some reason?

You look at the end of the file which tells you where the central directory is. The directory tells you where individual files are.