# Zip圧縮 def compress(path, zippath) File.unlink zippath if File.file?(zippath) Zip::File.open(zippath, Zip::File::CREATE) do |z_fp| z_fp.add(File.basename(path), path) end outpath end # Zip解凍 def uncompress(path, outpath) entrys = [] Dir.mkdir(outpath) unless Dir.exist?(outpath) # 2つ目の引数はoffset Zip::InputStream.open(path, 0) do |input| # get_next_entryするとinputのoffset(ポインタ)が動く while (entry = input.