momo33 has asked for the wisdom of the Perl Monks concerning the following question:
I would like to manipulate a cpio archive. CPAN has http://search.cpan.org/~pixel/Archive-Cpio-0.07/ This looks just what I need. Unfortunately, it does not what I expect.
Im my cpio archive test.cpio are three files: test1, test2, and test3
use Archive::Cpio; my $cpio = Archive::Cpio->new; $cpio->read('test.cpio'); $cpio->remove('test1'); $cio->write('newtest.cpio');
Unfortunately, test.cpio is identical to newtest.cpio; I want test1 to be gone. Is this a bug or my mistake?
One step further, I would like to insert a new file: new1. The docs
give me $cpio->add_data($filename, $data, $opthashref).
$cpio->add_data('new1',$data, ???) did not do it. In addition, I have no idea about $opthashref. Any suggestions?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: manipulating cpio archive
by Corion (Patriarch) on Jan 16, 2011 at 20:29 UTC | |
by momo33 (Beadle) on Jan 17, 2011 at 18:32 UTC | |
by Corion (Patriarch) on Jan 17, 2011 at 18:39 UTC | |
by momo33 (Beadle) on Jan 17, 2011 at 19:20 UTC | |
by Corion (Patriarch) on Jan 17, 2011 at 19:34 UTC | |
|