Quantcast
Channel: Question and Answer » fifo
Viewing all articles
Browse latest Browse all 15

Triggering zero-byte reads on FIFO/pty

$
0
0

I’d like to know how to emulate the ICANON behavior of ^D: namely, trigger an immediate, even zero-byte, read in the program on the other end of a FIFO or PTY or socket or somesuch. In particular, I have a program whose specification is that it reads a script on stdin up until it gets a zero byte read, then reads input to feed the script, and I’d like to automatically test this functionality.

Simply writing to a FIFO doesn’t result in the right thing happening, of course, since there’s no zero byte read. Help?

Thanks!


Viewing all articles
Browse latest Browse all 15

Trending Articles