[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Without having tested it, it looks like you should check the return values
from mkfifo, open etc. to detect and print ny errors.
The root is read only so depending on where you run your program from
"./FIFO" might not be created, try "/tmp/FIFO" instead.
From: Justin Flik <email@example.com>
Date: den 25 november 2000 22:19
>I just writing a program in C++ at elinux. I need to communicate between
>processes and like to use FIFOs. The trouble is, that I get errors if I try
>to read or write on it. (The same code is running on my PC with no
>Furthermore it seems that elinux ignores the blocking mechanism - this
>it returns the open-function even if it should not! open("FIFO",RDONLY) has
>the same effect than open("FIFO",RDONLY|O_NONBLOCK) !? where noone else
>opens the same FIFO in write-mode.
>Could it be that FIFOs aren't implemented correctly in elinux yet? Or did i
>do something wrong in my code:
> fd=open("./FIFO",RDONLY); // should be wait till process
> read(fd,&ch,1); // TWO opens FIFO to write
> write(fd,"hello world",12);
>hope you can help me
>thanks in advance
>Get more from the Web. FREE MSN Explorer download :
>This Hotmail WebCourier newsletter has been sent to you from
>Get your own FREE subscription in a few easy steps.
>I do not have a Hotmail account:
>Choose this or any of our 60+ newsletters while registering for a free
>Hotmail e-mail account. http://www.hotmail.com
>I am a current Hotmail user:
>Sign in at http://www.hotmail.com, then click Free News in the left menu.
>Check the box next to , then click OK.