[erlang-bugs] dets deletes non-dets files

Håkan Mattsson <>
Thu Jan 30 13:12:10 CET 2014


I run into a dets bug the other day. If dets tries to open a file that 
not is a dets file, it simply deletes it. It even deletes the file when 
access is set to read and repair is false. Scary.

The bug is easy to reproduce:

% erl
Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:8:8] 
[async-threads:10] [hipe] [kernel-poll:false]

Eshell V5.10.4  (abort with ^G)
1> file:write_file("foo",<<"foo">>).
ok
2> file:read_file("foo").
{ok,<<"foo">>}
3> dets:open_file("foo",[{access,read},{repair,false}]).
{error,{file_error,"foo",enoent}}
4> file:read_file("foo").
{error,enoent}
5>

/Håkan



More information about the erlang-bugs mailing list