Changeset 19 for trunk


Ignore:
Timestamp:
09/27/05 17:40:11 (19 years ago)
Author:
thauvin
Message:

update doc

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  
    7979            DIR => $self->_tempdir, 
    8080            UNLINK => 1, 
    81         ) or return undef; 
     81        ) or do { 
     82            seterror("Can't create tempfile: $!"); 
     83            return undef; 
     84        }; 
    8285    } 
    8386     
    8487    if(!copy($self->{archive}, $fh)) { 
    8588        unlink($fname); 
     89        seterror("Cant copy the archive: $!"); 
    8690        return undef; 
    8791    } 
     
    116120__END__ 
    117121 
    118 =HEAD1 Method 
     122=head1 NAME 
    119123 
    120 =item new 
     124ObsData::Archive - Transparently extract files from arbitrary archives 
    121125 
    122 Create a new archive object 
     126=head1 SYNOPSIS 
    123127 
    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 
     140Create a new archive object by reading $file. 
     141 
     142Return undef on error and set error status. 
     143See L<error>. 
     144 
     145=head2 ls 
    125146 
    126147list the content of the archive 
    127148 
    128 =item extract 
     149=head2 extract 
    129150 
    130151Extract a file from the archive and return the filename of extract file 
     152 
     153=head1 CLASS METHODS 
     154 
     155=head2 error 
     156 
     157Return the last error encoutered 
     158 
     159=head1 AUTHORS 
     160 
     161Olivier Thauvin <olivier.thauvin@aerov.jussieu.fr> 
     162 
     163=cut 
Note: See TracChangeset for help on using the changeset viewer.