Re: Implementing "cpio -tv < file.cpio" with glib routines



Colossus wrote:
Hi,

How can I code with g_spawn_* glib routines the command in the subject
line ? Alternatively I noticed that

"cat file.cpio | cpio -tv" also works but how to implement also this
with g_spawn family ?

1) spawn 'cpio -tv' with a pipe in and a pipe out
2) create non-blocking g_io_channels from these pipes
3) register callbacks with g_io_add_watch() for the io channels, one of
these functions should write, the other one read

you might want to look at 'external_commands.c' from the Bluefish source
code, it can process data through external commands, using pipes, fifo's
or temporary files.

regards,
        Olivier




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