Greeetings.
I have a windows folder full of .tif files, with names like:
123-monday.tif
234-monday-1of2.tif
345-monday-2of2.tif
I have pooly crafted a script to read all the filenames in the directory, pull out the day and create a zip called monday.zip
My problem is it willput these 3 files in, but each time it moves to the next file it removes the previous file. So as an example once the script is run the only file I have in the zip is 345-monday-2of2.tif. I tested by putting in a sleep command, stopping the script and looking in the zip, at the point I stopped it I could see it was putting the previous file in, but once it goes forward it kills the contents.
I am not declaring the zip name, I read the filename, extract the day and name it monday.zip.
my $zip = Archive::Zip->new();
my $member = $zip->addDirectory( 'dirname/' );
$member->desiredCompressionMethod();
$member = $zip->addFile( "$file_to_zip", "$file_name" );
+
die 'write error' unless $zip->writeToFileNamed( $zip_file_name )
+== AZ_OK;
is there a way to make it not clear the zip file? I want this so each day it can scan a directory and add files to the already existing zip. Did I explain well enough?