Openbsd-Ustar

OpenBSD::Ustar(3p) Perl Programmers Reference Guide OpenBSD::Ustar(3p)

Openbsd-Ustar

OpenBSD::Ustar(3p) Perl Programmers Reference Guide OpenBSD::Ustar(3p) # OpenBSD::Ustar(3p) Perl Programmers Reference Guide OpenBSD::Ustar(3p) NNAAMMEE # OpenBSD::Ustar - simple access to Ustar "tar(1)" archives SSYYNNOOPPSSIISS # use OpenBSD::Ustar; # for reading open(my $in, "<", $arcnameforreading) or die; $rdarc = OpenBSD::Ustar->new($in, $state, $destdir); $rdarc->set_description($arcnameforreading); while (my $o = $rdarc->next) { # decide whether we want to extract it, change object attributes $o->create; } $rdarc->close; # for writing open(my $out, ">", $arcnameforwriting) or die; $wrarc = OpenBSD::Ustar->new($fh, $state, $destdir); # loop my $o = $wrarc->prepare($filename); # tweak some entry parameters $o->write; $wrarc->close; # for copying open(my $in, "<", $arcnameforreading) or die; $rdarc = OpenBSD::Ustar->new($in, $state, $destdir); open(my $out, ">", $arcnameforwriting) or die; $wrarc = OpenBSD::Ustar->new($fh, $state, $destdir); while (my $o = $rdarc->next) { $o->copy($wrarc); } $rdarc->close; $wrarc->close; DDEESSCCRRIIPPTTIIOONN # "OpenBSD::Ustar" provides an API to read, write and copy archives compatible with tar(1). ...