deprecated endOfFile and readLine
This commit is contained in:
parent
02e8e9c3ea
commit
4b39ac5cbe
6 changed files with 59 additions and 29 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue