diff options
author | Araq <rumpf_a@web.de> | 2011-11-12 02:10:07 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-11-12 02:10:07 +0100 |
commit | 40fa4bb52dd49f7dd1c3485c995c3652697c78c6 (patch) | |
tree | 79fbd1407a8320a4f6346c39d76b780e56e078b9 /lib/pure/osproc.nim | |
parent | 3b6d831549d5e5214a1712605e7b375444ad342f (diff) | |
download | Nim-40fa4bb52dd49f7dd1c3485c995c3652697c78c6.tar.gz |
better streams implemenation; fixes #63
Diffstat (limited to 'lib/pure/osproc.nim')
-rwxr-xr-x | lib/pure/osproc.nim | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index c9b536c0a..608fce013 100755 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -171,7 +171,7 @@ proc execProcesses*(cmds: openArray[string], when defined(debugExecProcesses): var err = "" var outp = outputStream(q[r]) - while running(q[r]) or not outp.atEnd(outp): + while running(q[r]) or not atEnd(outp): err.add(outp.readLine()) err.add("\n") echo(err) @@ -213,10 +213,10 @@ when not defined(useNimRtl): var p = startCmd(command, options=options) var outp = outputStream(p) result = TaintedString"" - while running(p) or not outp.atEnd(outp): + while running(p) or not atEnd(outp): result.string.add(outp.readLine().string) result.string.add("\n") - outp.close(outp) + close(outp) close(p) when false: @@ -259,10 +259,10 @@ when defined(Windows) and not defined(useNimRtl): proc newFileHandleStream(handle: THandle): PFileHandleStream = new(result) result.handle = handle - result.close = hsClose - result.atEnd = hsAtEnd - result.readData = hsReadData - result.writeData = hsWriteData + result.closeImpl = hsClose + result.atEndImpl = hsAtEnd + result.readDataImpl = hsReadData + result.writeDataImpl = hsWriteData proc buildCommandLine(a: string, args: openarray[string]): cstring = var res = quoteIfContainsWhite(a) @@ -643,10 +643,10 @@ proc execCmdEx*(command: string, options: set[TProcessOption] = { result = (TaintedString"", -1) while true: if result[1] == -1: result[1] = peekExitCode(p) - if result[1] != -1 and outp.atEnd(outp): break + if result[1] != -1 and atEnd(outp): break result[0].string.add(outp.readLine().string) result[0].string.add("\n") - outp.close(outp) + close(outp) close(p) |