在 Ruby 中处理 Zip 文件 [英] Processing Zip files in Ruby

查看:31
本文介绍了在 Ruby 中处理 Zip 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复:
如何在 ruby​​ 中仅在内存中创建 zip 文件?

有人知道允许用户在内存中处理 zip 文件条目的开源 Ruby 库吗?即不将它们写入磁盘

Is anybody aware of a open source Ruby library that allows the user to process zip file entries in memory? i.e. without writing them to disk

推荐答案

我正在使用 rubyzip 库.你可以这样做:

Hi I'm using rubyzip library. You can do something like this:

Zip::ZipFile.foreach(file) do |entry|
    istream = entry.get_input_stream
    data = istream.read
    #...
end

这篇关于在 Ruby 中处理 Zip 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆