aspose.info
FIL

GZ File Format - GNU Zipped Archive File

Na-update

Ano ang isang GZ file?

Ang GZ file ay isang naka-compress na archive na ginawa gamit ang karaniwang gzip (GNU zip) compression algorithm. Maaaring naglalaman ito ng maramihang mga naka-compress na file, mga direktoryo at mga file stub. Ang format na ito ay unang binuo upang palitan ang mga format ng compression sa mga UNIX system. at isa pa rin sa mga pinakakaraniwang uri ng archive sa mga sistema ng Linux. Ang mga application tulad ng WinZip ay maaaring magbukas ng mga GZ file upang tingnan ang mga nilalaman nito sa parehong Windows at MacOS.

GZ File Format - Higit pang Impormasyon

Ginagamit ng Gzip ang DEFLATE algorithm para sa compression ng archive at naiiba sa ZIP na format ng archive sa paglalapat ng compression algorithm sa kumpletong archive sa halip na mga indibidwal na file. Ang mga detalye ng format ng file ng GZIP na bersyon 4.3 na inilathala ng Internet Engineering Task Force (IETF) ay naglalaman ng detalyadong impormasyon tungkol sa format ng file. Ang format ng file ay binubuo ng:

  • File Header
  • Optional Headers
  • Compressed Data
  • File Footer

GZ File Header

Ang header ng GZ file ay binubuo ng 10 byte gaya ng sumusunod:

OffsetSizeValueDescription
020x1f 0x8bMagic number identifying file type
21Compression Method * 0-7 (Reserved) * 8 (Deflate)
31File Flags
4432-bit timestamp
81Compression flags
91Operating system ID

File Flags

ValueIdentifierDescription
0x01FTEXTIf set the uncompressed data needs to be treated as text instead of binary data. This flag hints end-of-line conversion for cross-platform text files but does not enforce it.
0x02FHCRCThe file contains a header checksum (CRC-16)
0x04FEXTRAThe file contains extra fields
0x08FNAMEThe file contains an original file name string
0x10FCOMMENTThe file contains comment
0x20Reserved
0x40Reserved
0x80Reserved

Operating System

ValueDescription
0FAT filesystem (MS-DOS, OS/2, NT/Win32)
1Amiga
2VMS (or OpenVMS)
3Unix
4VM/CMS
5Atari TOS
6HPFS filesystem (OS/2, NT)
7Macintosh
8Z-System
9CP/M
10TOPS-20
11NTFS filesystem (NT)
12QDOS
13Acorn RISCOS
255unknown

GZ Optional Headers

Ang mga opsyonal na karagdagang header ay ang mga nakasaad sa mga flag ng file at may kasamang impormasyon tulad ng orihinal na filename, mga karagdagang field, komento at checksum ng header.

Compressed Data

Ang seksyong ito ay naglalaman ng naka-compress na data gamit ang DEFLATE compression algorithm.

Ang footer ng file ay 8 bytes ang laki at naglalaman ng sumusunod na impormasyon.

OffsetSizeDescription
04Checksum (CRC-32)
44Uncompressed data size value in bytes

Mga Sanggunian

Tingnan din