在 Ruby 中读取 zip 文件中的文件注释
I am doing Python challenge in Ruby. I need to read the file contents and comments from a Zip file. The content is no problem with the RubyZip gem but I am unable to get the comments out. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据文档, RubyZip ZipFile 类的实例有一个
注释
属性,返回 zip 文件的注释(如果有的话)。例如
According to the documentation an instance of the RubyZip ZipFile class has a
comment
attribute which returns the zip file's comment, if it has one.e.g.
实际上,您需要每个文件的注释,而我很难找到这些文件 文档。以下是如何从文件中获取注释的示例。
You'll actually want the comments from each of the files, which I had a much harder time finding documentation on. Here's an example of how to get the comment from a file.