The fourth arg of read is wrong. It should be 0 or simply omitted.
If you're going to read one character at a time, getc would be clearer. But I recommend reading all available data instead of one character at a time. You can do that using sysread since it returns all available data (up to the specified limit) as soon as any data is available.
In reply to Re^4: Nested line buffered output
by ikegami
in thread Nested line buffered output
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |