- Timestamp:
- 09/27/05 17:40:11 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/soft/ObsData/ObsData/Archive.pm
- Property cvs2svn:cvs-rev changed from 1.6 to 1.7
r18 r19 79 79 DIR => $self->_tempdir, 80 80 UNLINK => 1, 81 ) or return undef; 81 ) or do { 82 seterror("Can't create tempfile: $!"); 83 return undef; 84 }; 82 85 } 83 86 84 87 if(!copy($self->{archive}, $fh)) { 85 88 unlink($fname); 89 seterror("Cant copy the archive: $!"); 86 90 return undef; 87 91 } … … 116 120 __END__ 117 121 118 = HEAD1 Method122 =head1 NAME 119 123 120 =item new 124 ObsData::Archive - Transparently extract files from arbitrary archives 121 125 122 Create a new archive object 126 =head1 SYNOPSIS 123 127 124 =item ls 128 use ObsData::Archive; 129 my $file = "foo.tar.gz"; 130 my $oa = ObsData::Archive->new($file) or die ObsData::Archive->error; 131 my @content = $oa->ls; 132 foreach (@content) { 133 $oa->extract($_, "./$_") or die ObsData::Archive->error; 134 } 135 136 =head1 METHODS 137 138 =head2 new($file, %options) 139 140 Create a new archive object by reading $file. 141 142 Return undef on error and set error status. 143 See L<error>. 144 145 =head2 ls 125 146 126 147 list the content of the archive 127 148 128 = itemextract149 =head2 extract 129 150 130 151 Extract a file from the archive and return the filename of extract file 152 153 =head1 CLASS METHODS 154 155 =head2 error 156 157 Return the last error encoutered 158 159 =head1 AUTHORS 160 161 Olivier Thauvin <olivier.thauvin@aerov.jussieu.fr> 162 163 =cut
Note: See TracChangeset
for help on using the changeset viewer.