设定的压缩的水平,当产生一个压缩文件使用RubyZip
-
20-09-2019 - |
解决方案
这里是代码是我创造的看rubyzip内部。
level = Zlib::BEST_COMPRESSION
Zip::ZipOutputStream.open(zip_file) do |zip|
Dir.glob("**/*") do |filename|
entry = Zip::ZipEntry.new("", filename)
entry.gather_fileinfo_from_srcpath(filename)
zip.put_next_entry(entry, nil, nil, Zip::ZipEntry::DEFLATED, level)
entry.get_input_stream { |is| IOExtras.copy_stream(zip, is) }
end
end
其他提示
你可能会得到更好的牵引力,通过叫出来的'拉链'的程序或不做什么的荏苒.
不隶属于 StackOverflow