YPAK File Format is a file format for storing directories as a compressed archive. YPAK File Format is very similar in design and usage to the ID Software’s PAK file format for the Quake™ Game Engine and the ubiquitous tar file format. YPAK uses GZIP compression for files.
The YPAK File has two major parts:
1) The file Header
The YPAK File header specifies information like the number of entries in the file and the offset to the first entry and the CRC Checksum of the file.
2) The Entries
The Entry again has a entry header and a entry data section. The entry header contains the name of the entry, the uncompressed size of the entry data, the compressed size of the entry data, offset to the entry data and whether the entry is a file or a directory.
The Entry Data if compressed is just a GZIP compressed byte stream for the original entry data.
As a better explanation, the YPAK file format can be expressed as the following C-style structures.