Sorry the second the redefinition of file in invocation of openAsync it's my
mistake.
This compile but I get the same error:
import asyncdispatch, asyncfile, os
proc main() {.async.} =
var filename = "test.txt"
var file = openAsync(filename, fmRead)
while true:
let line = await file.readLine()
if line.len == 0: break
echo line
file.close()
waitFor main()
Run
Exception message: index out of bounds
Exception type: [IndexError]
Error: execution of an external program failed:
'/home/hdias/Downloads/tmp/test '