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