2009_da_lmp.zip
。直接从Rubyzip存储库中的示例中使用代码,我可以确认可以列出存档文件内容:
#f is the absolute path to 2009_da_lmp.zip (string)
Zip::ZipFile.open(f) { |zf| zf.entries[0] }
=> 20090101_da_lmp.csv #that is indeed a file in the archive.
使用存储库中的示例中的更多代码,我尝试在存档中获取一个实际文件:
Zip::ZipInputStream.open(f) { |zis|
entry = zis.get_next_entry
print "first line of '#{entry.name}' (#{entry.size} bytes: ) "
puts "'#{zis.gets.chomp}'" }
=> first line of '20090101_da_lmp.csv' (826610 bytes: ) Zlib::DataError:
invalid stored block lengths #and a long stack trace I can provide
#if that might help
MacOS解压缩实用程序解开档案罚款。我想知道这是否是某种编码相关的东西(我的语言环境设置为en_us.utf-8,因为要在dev中使用postgresql少痛苦),但是我不知道如何判断是否是这种情况。我找不到有关可能导致此错误的任何信息。