Re: gtk_input_add



There is your problem. it is not S_IRUSR & S_IWUSR, but S_IRUSR | S_IWUSR.
You have to use bitwise OR to add the params, not bitwise AND. And I am
surprised that this got past the rest of the people on the list. Shame on
you all.

Bruce

----- Original Message -----
From: "ASF" <Anthony-Ferrand wanadoo fr>
To: "GTK" <gtk-list gnome org>
Sent: Wednesday, November 22, 2000 9:09 AM
Subject: 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
>
>
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list





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