[erlang-questions] eof or not eof for zero length

Volodymyr Kyrychenko vladimir.kirichenko@REDACTED
Fri Oct 7 10:56:38 CEST 2011


Hello,  Erlangers

Having this code

1> {ok, F} = file:open("build.sh",[read,raw,binary]).
{ok,{file_descriptor,prim_file,{#Port<0.600>,7}}}
2> file:pread(F, 0, 0).
eof
3> file:pread(F, 0, 1).
{ok,<<"#">>}

makes me think that result of second line is not correct, it obviously
should not be EOF, it should be {ok, <<>>}. What do you think?

-- 
Best Regards,
Volodymyr Kyrychenko



More information about the erlang-questions mailing list