-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when reading asynchronous text file line by line #10641
Comments
With fix #10640 I get another error:
$ nim c -r test.nim |
It's not an error, if you read past the |
Ok, how to find the end of a file in this case?
Example in C:
|
proc main() {.async.} =
var fh = openAsync("test.txt", fmRead)
try:
let line = await fh.readLine()
echo line
except EOFError:
discard
finally:
fh.close()
waitFor main() |
But with your code I read only one line!!! |
I find a way to make this work:
|
When I tried to read a text file asynchronous line by line it gives an error and only reads the first line.
Example
Current Output
Additional Information
The text was updated successfully, but these errors were encountered: