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

Volodymyr Kyrychenko vladimir.kirichenko@REDACTED
Fri Oct 7 11:34:53 CEST 2011

Another one:

1> {ok, B} = file:read_file("build.sh").
{ok,<<"#!/bin/sh\nrebar compile || exit -1\nmkdir -p
out\n\nMODULES=\"common leveldb yaws csv eunit io\"\n\nfor m in
2>  L = length(binary_to_list(B)).
3> {ok, F} = file:open("build.sh", [read]).
4> file:pread(F, L+100,10).
5> file:pread(F, L+100,0).

Line 5 definitely should be eof.

Best Regards,
Volodymyr Kyrychenko

More information about the erlang-questions mailing list