[erlang-bugs] dets:open_file/1 repairs when it shouldn't?

Hans Bolinder hans.bolinder@REDACTED
Wed Mar 18 10:08:41 CET 2009


[Ulf Wiger:]
> Reading the documentation for dets:open_file/1, it says:
> 
> "Opens an existing table. If the table has not been properly closed,
> the error {error, need_repair} is returned."
> 
> (http://www.erlang.org/doc/man/dets.html - R12B-5, I assume.)
> 
> Yet,
> 
> Eshell V5.6.4  (abort with ^G)
> 1> dets:open_file("dets_file",[{repair,false}]).
> {error,{needs_repair,"dets_file"}}
> 2> dets:open_file("dets_file").
> dets: file "dets_file" not properly closed, repairing ...
> {ok,#Ref<0.0.0.41>}
> 
> In other words, open_file/1 is unlikely to ever return the
> {error,need_repair} that the documentation talks about.
> 
> It should either be described as returning {error, {'needs_repair',
> Fname}} (if the implementation is changed to default to
> {repair,false}, or the documentation should state that the file is
> automatically repaired.

Thanks. I'll update the docs.

Best regards,

Hans Bolinder, Erlang/OTP team, Ericsson



More information about the erlang-bugs mailing list