English 中文(简体)
齐普档案中是否有难以链接?
原标题:Are hard links possible within a zip archive?

我正在建立一个齐普的档案,在不同的道路上载有两个相同的档案。 焦普档案格式是否支持类似于“团结”的硬联系概念? 因此,我指的是只储存一次档案(节省空间)的能力,但能够将这一数据推向齐普档案中的两个不同途径。

如果档案格式确实支持这一点,那么我如何能够利用自由工具在乌班图建立这样一个档案?

最佳回答

http://en.wikipedia.org/wiki/Zip_%28file_format%29。 Zip文档格式不支持这一点。 这是因为,当地档案负责人包含有关档案的信息,包括其名称,然后立即提供文件压缩数据。 两个不同的地方档案负责人不可能看到同样的压缩数据。

问题回答

正如@Greg所说的那样,国际知识产权协会不支持硬联系。

但是,如果我理解正确的话,你的目的是减少压缩档案的规模。 因此,要考虑另一种解决办法。

Lets run simple tests to check compression ratio of different archive libraries. I ve created two identical binary files and compressed them using ZIP, BZ2, RAR and 7z.

  8641969  test.bin
  8641969  test2.bin

First time only one file was compressed. Second time two files were compressed:

<>ZIP:

$zip -9 test1.zip test.bin
$zip -9 test2.zip test.bin test2.bin

 8636837  test1.zip
17273654  test2.zip 

www.un.org/Depts/DGACM/index_spanish.htm

$export BZIP=--fast
$tar cjf test1.tbz test.bin 
$tar cjf test2.tbz test.bin test2.bin 

 8694997  test1.tbz
17389167  test2.tbz

<>7z:

$7z a -mx=9 test1.7z test.bin 
$7z a -mx=9 test2.7z test.bin test2.bin 

 8705285  test1.7z
 8707054  test2.7z

<>RAR:

$rar a -m5 test1.rar test.bin
$rar a -m5 test2.rar test.bin test2.bin 

 8649970  test1.rar
17299916  test2.rar

Conclusion: It seems that only 7z does the job good. Consider using it in your application.

当然,你将需要在你的环境里用你的档案进行更多的测试,看看它是否真的需要。 你们还可以选择,了解你能达到何种程度的压缩率/速度平衡。

tar 档案支持硬链接





相关问题
BlackBerry - Unpack Zip File

I m developing a BlackBerry application in which I need to unpack a zip file compressed with PKZIP. The package could have one file in it, or it could have 10; it will vary in each case. I know that ...

How to find if a request is for js or css in httpHandler

is there any way to find if a particular request is for JS or CSS in httphandler to improve the performance of my website i was using HttpCompress from Code Project http://www.codeproject.com/KB/...

Compress data before storage on Google App Engine

I im trying to store 30 second user mp3 recordings as Blobs in my app engine data store. However, in order to enable this feature (App Engine has a 1MB limit per upload) and to keep the costs down I ...

How to process compressed data in Java

I have some data which takes up more than 50MB in an uncompressed file, but compresses down to less than half a MB using gzip. Most of this is numerical data. I m trying to figure out how to process ...

What is the best way to extract a zip file using java

I have a a zipped file. That file contains various directories and files also. I want to extract all those and save in a specified path. So How to write a java program to extract the zipped file. ...

热门标签