You are not logged in.
I have written a program having two processes P1 and P2. P1 sends binary data from one end via a named pipe. P2 on the other end which receives the data is actually a shell script which
uses a cat cmd to named pipe which in turn sends to some other binary some thing like cat "/tmp/named_pipe" > bin (in P2 shell script)
I see cat is blocked on named pipe even when the other end of the pipe ie P1 is done with sending binary data. Can any one let me know how can I inform cat that other end is done
sending data hence unblock ??
P1 -----------> named pipe ---------------> P2 (shell script some thing like cat "/tmp/named_pipe" > bin )
Thanks for the help in advance.
yes i have done but no effect. what i observed also when i simply cat a named pipe's file whose both ends are dead, cat hangs looks like it expect some data in file which is not availiable and will never be hence hangs infinitely.
If you start the cat after the close of the writer, then yes it'll wait around for another writer... But, if you do the close while the cat is blocked waiting to read, that should signal EOF and terminate the cat...