[erlang-questions] DETS - {error,{not_closed, <FILE>}}

Phillip Sibanda <>
Thu Sep 12 09:17:05 CEST 2013


Hello Everyone,

I have a Proc A which has an open Dets table and is doing a high rate of 
read and writes to the Dets table.

I would like Proc B to have read-only access to same Dets table. An 
attempt to open the file with read-only access by Proc B results in 
{error,{not_closed, <FILE>}} as follows

 > dets:open_file(tab, [{access, read}, {file, <FILE>}]).
     {error,{not_closed, <FILE>}}

Proc A and Proc B are not running within the same ERTS.

However when Proc B attempts to open the table in read-write(default) 
mode, the table is opened successfully. From my understanding the 
default option works because it will result in an attempt to repair the 
table before it is opened. I'm bit wary of this because I want only 
Process A to make any changes to the table.

My questions:

1. Is there an alternative way to allow Process B read-only access to 
the table?
         - preferably without Process A closing the table

2. Do I understand correctly that the default option works because the 
table is repaired?

Regards,
Phillip
-- 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130912/daa2af46/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pharos_signature.jpg
Type: image/jpeg
Size: 22822 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130912/daa2af46/attachment.jpg>


More information about the erlang-questions mailing list