diff --git a/stdlib/ext/file-ext.mc b/stdlib/ext/file-ext.mc index 3443d8ba4..a38795de3 100644 --- a/stdlib/ext/file-ext.mc +++ b/stdlib/ext/file-ext.mc @@ -120,12 +120,12 @@ with ("Hello", "Next string", "Final", "EOF") in -- Test reading x amount of characters from the file utest - match readOpen filename with Some rc then - let l1 = match readBytes rc 3 with Some s then s else "" in - let l2 = match readBytes rc 4 with Some s then s else "" in - let l3 = match readBytes rc 0 with Some s then s else "" in - let l4 = match readBytes rc 1 with Some s then s else "" in - readClose rc; + match fileReadOpen filename with Some rc then + let l1 = match fileReadBytes rc 3 with Some s then s else "" in + let l2 = match fileReadBytes rc 4 with Some s then s else "" in + let l3 = match fileReadBytes rc 0 with Some s then s else "" in + let l4 = match fileReadBytes rc 1 with Some s then s else "" in + fileReadClose rc; (l1,l2,l3,l4) else ("Error reading file","","","") with ("Hel", "lo\nN", "", "e") in