Subject: | Mtime => $number option not honored by IO::Compress::zip |
Date: | Wed, 8 Jul 2015 17:16:09 -0700 |
To: | bug-IO-Compress [...] rt.cpan.org |
From: | Chandra Nagarajan <cs3chan [...] gmail.com> |
I see that the gzip function in *IO-Compress-2.020*
<http://search.cpan.org/~pmqs/IO-Compress-2.020/> > IO::Compress::Gzip
module mentions that the default behavior is to create a zipped file whose
mtime is the time at which the gzip was done. But I wanted a different
behavior and tried using the option ‘Time => $number’ to get the function
to create a zipped file with the same mtime as the original. It does not
seem to be working as expected.
Regards,
Chandra
Here is a section of my code that I was originally using:
IO::Compress::Gzip::gzip $rawlib => "$rawlib.gz" or die "$0 Error:
gzip of $rawlib to build $rawlib.gz failed: $GzipError\n";
unlink $rawlib or die "$0 Error: unable to delete souce file
$rawlib after gzipping\n";
Here is the modified version of my code.
my $time = (stat $rawlib)[9];
IO::Compress::Gzip::gzip $rawlib => "$rawlib.gz",Time => $time or
die "$0 Error: gzip of $rawlib to build $rawlib.gz failed: $GzipError\n";
unlink $rawlib or die "$0 Error: unable to delete souce file
$rawlib after gzipping\n";