- or download this
$ cpio --list -i <td.cpio
.
...
t3
1 block
$
- or download this
#!/opt/ActivePerl-5.12/bin/perl
use Archive::Cpio;
...
$cpio->read('td.cpio');
$cpio->remove('t1');
$cpio->write('tdnew.cpio');
- or download this
sub remove {
my ($cpio, @filenames) = @_;
...
my %filenames = map { $_ => 1 } @filenames;
@{$cpio->{list}} = grep { !$filenames{$_} } @{$cpio->{list}};
}