I am attempting to zip a folder (and the files within it) but not the subdirectories within it.
I have used the addTree function which works fine but also zips the subdirectories. I've also attempted the addDirectory and addFile functions neither of which I can get to work correctly. When i run my script with addDirectory i dont get any errors or warnings and the zip file is created but it is empty.
for example:Works perfectly butmy $zip = Archive::Zip->new(); $zip->addTree( 'C:\Users\Martin\Documents\Scripts\testfolder\\' ); unless ( $zip->writeToFileNamed($BACKUPNAME) == AZ_OK ) { die 'write error'; }
ormy $zip = Archive::Zip->new(); $zip->addFile( 'C:\Users\Martin\Documents\Scripts\testfolder\file1.txt +' ); unless ( $zip->writeToFileNamed($BACKUPNAME) == AZ_OK ) { die 'write error'; }
both create zip files but they are empty. Any ideas would be much appreciated. Thanksmy $zip = Archive::Zip->new(); $zip->addDirectory( 'C:\Users\Martin\Documents\Scripts\testfolder\\' ) +; unless ( $zip->writeToFileNamed($BACKUPNAME) == AZ_OK ) { die 'write error'; }
In reply to Problems with Archive::zip by Martinw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |