deprecated endOfFile and readLine

This commit is contained in:
Araq 2011-11-25 18:17:14 +01:00
commit 4b39ac5cbe
6 changed files with 59 additions and 29 deletions

View file

@ -25,10 +25,10 @@ proc consume() {.thread.} =
proc produce() {.thread.} =
var m: TMsg
var input = open("readme.txt")
while not endOfFile(input):
if chan.ready:
m.data = input.readLine()
chan.send(m)
var line = ""
while input.readLine(line):
m.data = line
chan.send(m)
close(input)
m.k = mEof
chan.send(m)