Skip Menu |

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

Report information
The Basics
Id: 40426
Status: resolved
Priority: 0/
Queue: Archive-Tar

People
Owner: Nobody in particular
Requestors: toddr [...] cpanel.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Archive Tar to support direct Archive::Tar::File adds
Hi, with this minor patch below, one could create tar files completeley in memory: diff --git a/Tar.pm b/Tar.pm index 839e113..2cd8cac 100644 --- a/Tar.pm +++ b/Tar.pm @@ -1308,6 +1308,10 @@ sub add_files { my @rv; for my $file ( @files ) { + if(ref($file) eq 'Archive::Tar::File') { + push @rv, $file; # Archive::Tar::File Object was passed directly. + next; + } unless( -e $file || -l $file ) { $self->_error( qq[No such file: '$file'] ); next;
From: todd.e.rinaldo [...] jpmorgan.com
I missed the subroutine add_data on first pass, but still, it might not be a bad idea to provide this interface...
On Mon Oct 27 13:31:00 2008, todd_rinaldo wrote: Show quoted text
> Hi, with this minor patch below, one could create tar files completeley > in memory: > > diff --git a/Tar.pm b/Tar.pm > index 839e113..2cd8cac 100644 > --- a/Tar.pm > +++ b/Tar.pm > @@ -1308,6 +1308,10 @@ sub add_files { > > my @rv; > for my $file ( @files ) { > + if(ref($file) eq 'Archive::Tar::File') { > + push @rv, $file; # Archive::Tar::File Object was passed > directly. > + next; > + } > unless( -e $file || -l $file ) { > $self->_error( qq[No such file: '$file'] ); > next;
Not a bad interface addition. This has been added now. Thanks for the patch!