From: Carlos Date: 2001-09-25T03:11:50+09:00 Subject: [ruby-talk:21642] Re: opening a named pipe? > > sendCmdToDiald( 'monitor', $STATUS_FIFO_NAME ) > > File.open($STATUS_FIFO_NAME,'r') do |status_fifo| > > # read from FIFO > > end > > Nope, tried that. Diald doesn't like it when there's no one reading on > the other end... it only starts writing if another process has *already* > opened the pipe for read when it gets the command to start writing. > I've confirmed this with tests on the command line, manually creating > pipes and telling Diald to write to them. If I have a 'cat' command > pending on a pipe, and then tell diald to write to that pipe, it works > and the 'cat' command starts displaying the diald output. But if I tell > diald to start writing, and then start 'cat /tmp/myfifo', (where > /tmp/myfifo is a fifo I've already created with mkfifo) then diald > complains: "could not open pipe /tmp/myfifo: No such device or address". Maybe you can open the pipe non-blocking File.open($STATUS_FIFO_NAME, File::RDONLY | File::NONBLOCK) or something like that (I don't have the necessary documentation; I only saw this form of opening a file as an example of File.new in the Rubybook).