pread(Handle, {eof,-N}, N) appears to be broken or have I misunderstood something?<br><br>/Joe<br><br>-module(bug1).<br><br>-compile(export_all).<br><br>bug() -><br> File = "test.bin",<br> file:write_file(File, [<<"123456789">>]),
<br> {ok, FileHandle} = file:open(File, [binary,raw,read]),<br> X1 = file:pread(FileHandle, 1, 2), <br> X2 = file:position(FileHandle, {eof,-4}),<br> X3 = file:pread(FileHandle, {eof,-4}, 3),<br> io:format("X1=~p~nX2=~p~nX3=~p~n~n",[X1,X2,X3]),
<br> file:close(FileHandle).<br><br> <br>1> c(bug1).<br>{ok,bug1}<br>2> bug1:bug().<br>X1={ok,<<"23">>}<br>X2={ok,5}<br>X3={error,einval}<br><br>ok<br><br> <br><br>