以编程方式访问 zip 文件中的文件?
我可以访问 zip 文件中的文件/文件夹而不将其解压到临时文件吗?
这是在linux系统上。
现在,我只需要从文件中“读取”,但是也可以“写入”它吗?
编辑 1:抱歉没有澄清,我希望有一个命令行工具,可以让它在任何语言上工作,但作为替代方案,我需要一个 PHP 解决方案/工具包。
Can I access a file/folder within a zip file without extracting it to a temporary file?
This is on a linux system.
Right now, I just need to "read" from the file, but is it possible to "write" to it as well?
Edit 1: Sorry for not clarifying, I was hoping for a command line tool that would allow it to work from any language, but as an alternate, a PHP solution / toolkit is what I would need.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您没有提到该语言,但 Java 有一个完整的库可用于读取和写入 zip 文件。
请参阅:http://download.oracle .com/javase/6/docs/api/java/util/zip/package-summary.html
对于 C 或 C++,您必须使用第三方库。
You don't mention the language, but Java has a whole library that can be used to read and write to a zip file.
See: http://download.oracle.com/javase/6/docs/api/java/util/zip/package-summary.html
For a C or C++, you'll have to use a 3rd party library.
对于 C 或 C++,请使用 zlib 和 minizip。
For C or C++, use zlib with minizip.