[erlang-questions] Passing Filehandles Between Processes

Davide Marquês nesrait@REDACTED
Thu Oct 8 23:31:48 CEST 2009


Hi there,

I did some tests a while ago trying out various read combinations.
Testing showed that:
 - files opened in raw mode get binded to the opening process and that
process is the only one that can read/write from it - read attempts by other
processes will block (although you can always route the read requests
through the process that opened the file);
 - files opened in non-raw mode can be access by other processes without any
problems;
 - finally, *the process that opened the file must be alive for read/write
operations to succeed*.

This last one seems like a good argument against trying to read/write
outside of the "file owner" process.

I'm attaching the code I used for testing in case someone is interested.

Cheers,
:Davide
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20091008/f1521b99/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_file.erl
Type: application/octet-stream
Size: 2605 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20091008/f1521b99/attachment.obj>


More information about the erlang-questions mailing list