bug-cpio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-cpio] How to remove a file from a CPIO archive without extracti


From: Pavel Raiskup
Subject: Re: [Bug-cpio] How to remove a file from a CPIO archive without extracting
Date: Thu, 27 Oct 2016 11:46:26 +0200
User-agent: KMail/5.3.1 (Linux/4.7.6-200.fc24.x86_64; KDE/5.26.0; x86_64; ; )

On Wednesday, October 26, 2016 4:07:39 PM CEST T.Senthil Nathan wrote:
> Could you please let me know how to remove a set of files from the
> source CPIO archive with out extracting it and writing in to a
> destination archive file.

Removing file from cpio archive "in place" is not easily possible.  The
remaining "hole" after removal is unavoidable without "writing it to at
least temporary file".

> I have explored cpio-filter (
> http://search.cpan.org/~pixel/Archive-Cpio-0.07/bin/cpio-filter), implemented
> in perl. Today it reads the complete CPIO file and removed the exclude
> content and write it in to the destination file.

Without looking at the project, if that already writes filtered cpio into
destination file, it should be easy to fix that so it reads from stream and
writes into stream.

It should be possible to fix GNU cpio so it works in "filter" mode, it's to be
discussed with maintianers of GNU cpio first.

> We want a cpio filter to work on a FIFO (name pipes) in which you will
> receive streams of 64K chunk of data, and apply this filter (exclude the
> file) on this stream and write in to the file.
>
> Do we have any filter which is already available, if not can you please
> throw some light on how to implement this.

Previous points are valid.  That's something we don't have in GNU yet (I think),
possibly try libarchive.so and create the filter manually.

Pavel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]