How to delete a non-empty folder in a zip file using Ruby gem 'zip' or 'rubyzip'? -


I tried to remove a non-empty folder in a zip file. I am using Ruby 1.8.7 in Ubuntu 10.10. I tried the rubyzip gem and the zip gem 'zip / zipfilesystem' zip: ZipFile.open ('apkfile.apk ') {| Zafile | Zfile.dir.delete ('META-INF')}

has reported the following error

ERROR :: ANNOTT: Any such file or No directory

Now I can only delete every entry in the directory and the directory will be removed after the last file in the directory to be removed.

  requires zip / zip file system 'Zip :: ZIPFile.Open (' apk file.apk '). Zafile | Zfile.file.delete ("META-INF / foo1.bar") zfile.file.delete ("META-INF / foo2.bar") zfile.file.delete ("META-INF / foo3.bar") end < / Code>  

Is it possible to use the FileUtils.rm_rf method in the file code gem in the zip file?

must be

  zip :: zip file.open ('foo .zip ') {| Zfile | Zfile.remove ('bar')}   



Comments