以编程方式访问 zip 文件中的文件?

发布于 2024-09-26 02:51:35 字数 177 浏览 0 评论 0原文

我可以访问 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 技术交流群。

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

发布评论

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

评论(2

各自安好 2024-10-03 02:51:35

您没有提到该语言,但 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.

她说她爱他 2024-10-03 02:51:35

对于 C 或 C++,请使用 zlibminizip

For C or C++, use zlib with minizip.

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