Pipes (and sockets and FIFOs) aren't seekable on most *NIX flavours I believe, so you're going to have to do your own buffering of some form. The less pager for instance spools piped input to a temporary file and then seeks on that. You could do something similar, or if you really only need one line just write your own one-line-buffering wrapper and use that to read rather than using your pipe filehandle directly.
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: reset filehandle position on a buffered pipe in
by Fletch
in thread reset filehandle position on a buffered pipe in
by johnvandam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |