ruby解压缩文件一般用什么方法

Python013

ruby解压缩文件一般用什么方法,第1张

file = File.new(“testfile”, “r”)# … process the filefile.closetestfile是想要操作文件名,”r”说明了文件的操作模式为读龋可以使用”w”表示写入,”rw”表示读写。最后要记得关闭打开的文件,确保所有被缓冲的数据被写入文件,所有相关的资源...

Zip::ZipFile::open("D:/test.zip") do |zfile|

zfile.each do |zent|

puts zent

puts zent.is_directory # 判断是不是目录 是目录你就创建一个就行了!

end

end