Re: gtk_input_add



>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"

>From the man page for mkfifo(3):

       Once you have created a FIFO special file in this way, any
       process can open it for reading or writing,  in  the  same
       way  as  an  ordinary file.  However, it has to be open at
       both ends simultaneously before you can proceed to do  any
       input  or  output  operations  on  it.  Opening a FIFO for
       reading normally blocks until some other process opens the
       same FIFO for writing, and vice versa.

You might want to check this. 

BTW, I would immediately cease the use of g_io_* and revert to
gtk_input_add(), unless your program is not a GTK program.

And I still think that whatever it is you're trying to do, you're
using the wrong basic model. Do you want to explain that again ?

--p




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