[erlang-bugs] lack of symmetry in format string for fwrite() and fread()

Bengt Kleberg <>
Wed Apr 23 13:55:11 CEST 2008


Greetings,

~b is missing in fread() format string and ~d is missing in fwrite()
format string.

Although properly documented I still feel that this is a bug in the
handling of integers in the format string for fwrite() and fread().

Exmaple:
> io:fwrite( "~b", [1]).
1
> io:fwrite( "~d", [1]).
** exception exit: {badarg,[{io,format,[<0.30.0>,"~d",[1]]},
                            {erl_eval,do_apply,5},
                            {shell,exprs,6},
                            {shell,eval_exprs,6},
                            {shell,eval_loop,3}]}
     in function  io:o_request/2

> io_lib:fread( "~d", "1").
{ok,[1],[]}
> io_lib:fread( "~b", "1").
{error,{fread,format}}



bengt




More information about the erlang-bugs mailing list