mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
18 lines
393 B
Nim
18 lines
393 B
Nim
discard """
|
|
output: "10"
|
|
"""
|
|
import osproc, os, streams
|
|
|
|
const filename = when defined(Windows): "ta_in.exe" else: "ta_in"
|
|
|
|
doAssert fileExists(getCurrentDir() / "tests" / "osproc" / filename)
|
|
|
|
var p = startProcess(filename, getCurrentDir() / "tests" / "osproc")
|
|
p.inputStream.write("5\n")
|
|
p.inputStream.flush()
|
|
|
|
var line = ""
|
|
|
|
while p.outputStream.readLine(line.TaintedString):
|
|
echo line
|