Re: gtk_input_add



Paul Barton-Davis wrote:

> >I don't understand something with the gtk_input_add function (again!).
> >I create a fifo (using mkfifo) and then I want to launch a function when
> >datas are accessible from this fifo.... so I use the gtk_input_add
> >function but when the process comes to the gtk_input_add line it just
> >stop. More exactly, the prog is running but it is just waiting for
> >something....
>
> do you mean it stops while executing gtk_input_add() ? show us the
> code - problems like this can almost never be solved from reading a
> non-code description.

Sorry my post was updated. Now, I use the GIO channel. But my problem was
the same:
.......
mkfifo("./fifo.sah", S_IRUSR);
fd=open("./fifo.sah", O_RDONLY);
channel=g_io_channel_unix_new(fd);
g_io_add_watch(channel,G_IO_IN,(GIOFunc) func2run, NULL); <- here the prog
wait and I must kill it
.......

It seems to me that I solve it replacing "S_IRUSR" by "S_IRUSR & S_IWUSR"
when I create the fifo...because now the prog run normally
......
mkfifo("./fifo.sah", S_IRUSR & S_IWUSR);
fd=open("./fifo.sah", O_RDONLY);
channel=g_io_channel_unix_new(fd);
g_io_add_watch(channel,G_IO_IN,(GIOFunc) func2run, NULL);
......

Now, I don't know how to use the fifo because when I try to write to
./fifo.sah, I get "permission denied"

Thanks in advance,

ASF






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