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 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. Is it possible to use the must be rubyzip gem and the
zip gem
'zip / zipfilesystem' zip: ZipFile.open ('apkfile.apk ') {| Zafile | Zfile.dir.delete ('META-INF')}
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>
FileUtils.rm_rf method in the file code gem in the zip file?
zip :: zip file.open ('foo .zip ') {| Zfile | Zfile.remove ('bar')}
Comments
Post a Comment