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

Phillip Sibanda phillips@REDACTED
Wed Sep 11 15:59:32 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>}}

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/20130911/8cdb3229/attachment.htm>
-------------- 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/20130911/8cdb3229/attachment.jpg>


More information about the erlang-questions mailing list