0
我在做什麼嘗試打開與rubyzip一個空白的docx,我不斷收到錯誤:紅寶石拉鍊不能打開的docx文件
Zip::Error: File /b;a/bla/bla/existing_file.docx not found
是否有rubyzip規則來阻止打開空zipfiles?
我在做什麼嘗試打開與rubyzip一個空白的docx,我不斷收到錯誤:紅寶石拉鍊不能打開的docx文件
Zip::Error: File /b;a/bla/bla/existing_file.docx not found
是否有rubyzip規則來阻止打開空zipfiles?
rubyzip
僅支持壓縮現有文件。你可以做的是使用touch
創建一個空文件,然後壓縮它。
require "fileutils"
FileUtils.touch '/b;a/bla/bla/existing_file.docx'