压缩文件后,新大小>旧尺寸 * 100,怎么可能?

发布于 2024-09-30 04:48:35 字数 50 浏览 1 评论 0原文

我们的首席执行官在一次会议上提出了这个问题,并强调在正常情况下在每台电脑上都是可能的!

Our CEO asked it in a meeting and emphasized it's possible under normal conditions on every pc !

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

2024-10-07 04:48:35

当然...打开记事本,输入单个字符并将文件另存为 test.txt。然后压缩该文件。生成的 zip 文件(在我的系统上)为 149 字节。像 ZIP 这样的压缩算法会消耗开销!

Sure... Open notepad, enter a single character and save the file as test.txt. Then zip this file. The resultant zip file is (on my system) 149 bytes. Compression algorithms like ZIP consume overhead!

ぇ气 2024-10-07 04:48:35

我不知道 zip 标头有多大,但充满 0 字节文件的目录就可以了。现在继续前进。

I don't know how big a zip header is, but a dir full of 0 byte files would do the trick. Now move along.

冷血 2024-10-07 04:48:35

非常简单:

~$ echo > singlebyte
~$ ls -l singlebyte 
-rw-rw---- 1 sleske sleske 1 Nov  2 22:55 singlebyte
~$ zip singlebyte.zip singlebyte 
  adding: singlebyte (stored 0%)
~$ ls -l singlebyte.zip 
-rw-rw---- 1 sleske sleske 171 Nov  2 22:55 singlebyte.zip

显然,对于小文件,开销将是相当大的。或者你有什么想法?

Very easy:

~$ echo > singlebyte
~$ ls -l singlebyte 
-rw-rw---- 1 sleske sleske 1 Nov  2 22:55 singlebyte
~$ zip singlebyte.zip singlebyte 
  adding: singlebyte (stored 0%)
~$ ls -l singlebyte.zip 
-rw-rw---- 1 sleske sleske 171 Nov  2 22:55 singlebyte.zip

Obviously, for small files the overhead will be considerable. Or what did you have in mind?

纵情客 2024-10-07 04:48:35

它在理论上是正确的(正如其他人已经表明的那样),但实际上并不重要。

It's theoretically right (as others have already shown), but practically unimportant.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文