Open Thomas008 opened 5 months ago
Hmm, do you have an MWI -- which os, etc.?
I'm using StaticCompiler on Windows (I adapted it to Windows), and Julia 1.10. Maybe this error is windows-specific. Perhaps someone could just check this on Linux. The code is simply:
using StaticTools
fn = m"test.txt"
mode = m"r"
fp = fopen(fn, mode)
str = readline(fp)
str = readline(fp)
fclose(fp)
free(str)
Hmm, I can't reproduce on Mac, so I suspect this is mostly likely be a Windows issue.
julia> using StaticTools
julia> fn = m"test.txt"
m"test.txt"
julia> mode = m"r"
m"r"
julia> fp = fopen(fn, mode)
Ptr{StaticTools.FILE} @0x0000000205e7e8a0
julia> str = readline(fp)
m"This is a test file!"
julia> str = readline(fp)
m"Here is the second line."
julia> fclose(fp)
0
julia> free(str)
0
Windows support is currently unofficial, but I'll continue to merge PRs if anyone who has a Windows machine to work on and does need/want it wants to make PRs
readline()
does not seem to read the first character in the first line of a file, and not the first two charachters from the second line on.