Hello there,
It was my understanding that peekableOutputStream would allow to use peekLine calls on a Stream. However, the following code spits out a runtime error:
import osproc, streams
let
process = startProcess(
"echo",
args = ["HELLO"],
options = {poUsePath, poStdErrToStdOut}
)
echo process.peekableOutputStream().peekLine()
output:
/home/francesco/.choosenim/toolchains/nim-1.6.0/li
b/pure/streams.nim(1097) peekLine
/home/francesco/.choosenim/toolchains/nim-1.6.0/li
b/pure/streams.nim(213) getPosition
SIGSEGV: Illegal storage access. (Attempt to read
from nil?)
Is this to be expected? How can I peek a line from an outputStream of a Process?
I see, thanks.
So I can only read from the pipe but I can't "preview" what I am going to read?