Skip Menu |
 

This queue is for tickets about the Archive-Zip CPAN distribution.

Report information
The Basics
Id: 4674
Status: resolved
Priority: 0/
Queue: Archive-Zip

People
Owner: Nobody in particular
Requestors: JFITZ [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.09
Fixed in: (no value)



Subject: overwrite method fails for archives without an extension
Download (untitled) / with headers
text/plain 829b
If one creates an Archive::Zip object for an archive that doesn't have an extension (say 'foo') then the overwrite() method deletes the file. The problem is the generation of the backup file name in overwriteAs(): ( my $backupName = $zipName ) =~ s{\.[^.]*$}{.zbk}; If $zipName doesn't match the substitution then $backupName keeps it's original state, which is the same as $zipName: Archive::Zip::Archive::overwriteAs(/usr/local/lib/perl5/site_perl/5.8.2/Archive/Zip.pm:762): 762: ( my $backupName = $zipName ) =~ s{\.[^.]*$}{.zbk}; DB<2> p $zipName foo DB<3> p $backupName foo DB<4> and since later on in the method $backupName is unlinked... kapoof goes the archive. This is probably not a common occurence (I only stumbled across it by accident), but a bit surprising I'm sure you'll agree. Regards.
Download (untitled) / with headers
text/plain 991b
[JFITZ - Sun Dec 14 13:30:48 2003]: Show quoted text
> If one creates an Archive::Zip object for an archive that doesn't have > an extension (say 'foo') then the overwrite() method deletes the file. > > The problem is the generation of the backup file name in > overwriteAs(): > > ( my $backupName = $zipName ) =~ s{\.[^.]*$}{.zbk}; > > If $zipName doesn't match the substitution then $backupName keeps it's > original state, which is the same as $zipName: > >
Archive::Zip::Archive::overwriteAs(/usr/local/lib/perl5/site_perl/5.8.2/Archive/Zip.pm:762): Show quoted text
> 762: ( my $backupName = $zipName ) =~ s{\.[^.]*$}{.zbk}; > DB<2> p $zipName > foo > DB<3> p $backupName > foo > DB<4> > > and since later on in the method $backupName is unlinked... kapoof > goes the archive. > > This is probably not a common occurence (I only stumbled across it by > accident), but a bit surprising I'm sure you'll agree. > > Regards.
Right. Thanks for sending this; it'll be fixed in the next release. Ned


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.