Re: g_spawning three processes: one after another only when...



Colossus wrote:
Colossus wrote:

Olivier Sessink wrote:

you could also spawn '/bin/sh cat archive.tar.bz2 |bzip2 -d | tar
--delete -v file_to_del | bzip2 > archive.tar,bz2'


There is a problem in the set of piped command above. The last filename
(the one in bzip2) must be different from the first one (the one in cat)
otherwise I get a bzip2 unexpected file end error.

hmm good point, so you need a temporary filename, and after the new
files is written, you need to move it.

b.t.w.: since you are writing some kind of file manager for tar.bz2
files, you could also keep the unzipped tar in memory (read it once),
and do all your modifications in memory, and each time you need to save,
you only need to pipe through bzip2, instead of both unzipping, doing
the operation and zipping at the same time (which is very cpu intensive).

regards,
        Olivier



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