g_io_channel problems



Hi,

I use g_spawn_async_with_pipes with these parameters:
if ( ! g_spawn_async_with_pipes (
                NULL,
                argv,
                NULL,
(GSpawnFlags) G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD|G_SPAWN_LEAVE_DESCRIPTORS_OPEN,
                NULL,
                NULL,
                &child_pid,
                NULL,
                &output_fd,
                &error_fd,
                &error) )

After that I set up an I channel:
        GIOChannel *ioc;
        ioc = g_io_channel_unix_new(fd);
50      g_io_channel_set_encoding (ioc, NULL, NULL);
51      g_io_channel_set_close_on_unref (ioc, TRUE);
        g_io_channel_set_flags (ioc, G_IO_FLAG_NONBLOCK, NULL );
        g_io_add_watch (ioc, cond, func, data);

The command to run is unzip -qq -vl foo.zip

However if I leave the lines 50 and 51 I always got printed a long list of (null), if I remove them I got the files in the zip archive plus some null. I look into the source of graveman and I see the author leaves those lines, the output of cdrecord is pure ascii as the one of unzip, why this different behaviour ?

Thanks,
--
Colossus

Cpsed, a Linux OpenGL 3D scene editor
http://cpsed.sourceforge.net/




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