Life Journal

随笔,及其他

我是 Xiao Xiao,在日本的产品经理,偶尔也写代码,iOS/Mac/Web,偶尔也做设计,爱用 Sketch,偶尔写文字,存在这里。


Small Talk on GZIP

If you are a windows system user,I would bet that you have never seen the gzip file(file with the file extension GZIP (gz)).’Cause it’s mostly used on UNIX and Linux/BSD,as a compression format.

When I take a look into the history of compression format,the most interesting thing I find is that the DEFLATE algorithm seems to be the origin of many modern compression algorithms.Though the LZW is much earlier,but for some patent reasons,LZW lost the chance to be put into use widely.

Files with a file extension GZIP (gz),uses the GZIP algorithm to compress.GZIP is also based on DEFLATE,and is commonly used together with tar,making a .tar.gz file.Because GZIP is unable to process a group of files,so we use tar to generate a file with file extension TAR from a group of files,then use gzip to make the final file with the file extension GZIP (gz),which seems like .tar.gz,or .tgz.

That is the most difference between GZIP and ZIP: ability to process a group of files or not.

But today we have a better choice for file compression,7-zip,as better realization of DEFLATE,it use a LZMA algorithm,the developed edition of LZW,to reach a higher compression rate.