BUG: in io:fread/3: doesn't return eof

david wallin david.wallin@REDACTED
Fri Oct 10 17:19:26 CEST 2003

Subject says it all really. With release R9C-0 io:fread/3 doesn't 
return 'eof' but an error.

The following function worked fine with R9B-1 but now I get an '{error, 
Error}' instead of 'eof'.

get_best_fitness(Io) ->

     case io:fread(Io, 'adhoc> ', "~d~f~f~d~f") of

	{ok, [Generation, BestFitness, AvgFitness, ValidSol, Entropy]} ->
	    {Generation, BestFitness} ;

	{error, Error} ->
	    io:format("~p.get_best_fitness: unexpected format '~p'\n", 
[?MODULE, Error]),
	    error ;

	eof -> eof




More information about the erlang-questions mailing list