in reply to what is EOF and how can I send it?
EOF is when you ask to read some byte(s) and you don't get an error but you get zero bytes read.
Interactively, CTRL-D flushes your input. If you've just flushed your input already (by pressing RETURN which queued up a newline then flushed the input), then flushing again with CTRL-D means that 0 bytes get flushed to the next read request (and so gets interpretted as EOF).
Most other forms of I/O don't support this abillity to flush all the way through to the reader without irreversibly closing the handle.
In other words, you're out of luck... unless you want to use a pseudo-tty...
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: what is EOF and how can I send it? (0 bytes read)
by Anonymous Monk on Jun 14, 2012 at 22:18 UTC |