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

Ulf Wiger ulf@REDACTED
Tue Mar 17 11:07:18 CET 2009


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.

BR,
Ulf W



More information about the erlang-bugs mailing list