[erlang-questions] Can a port use named pipes or other unnamed piped than the standard ones?
Roessner, Silvester
silvester.roessner@REDACTED
Fri Aug 8 08:16:57 CEST 2008
Hello,
can I open a port so it communicates via a named pipe or an unnamed pipe other than StdIn and StdOut?
The documentation says
open_port(PortName, PortSettings) -> port()
PortName = {spawn, Command} | {fd, In, Out}
{fd, In, Out}
Allows an Erlang process to access any currently opened file descriptors used by Erlang. The file descriptor In can be used for standard input, and the file descriptor Out for standard output. It is only used for various servers in the Erlang operating system (shell and user). Hence, its use is very limited.
But I haven't found details on {fd, In, Out} and how I could open a new fd.
Backgroud:
We have a legacy Fortran program (called Marez) that opens many files and uses this files as a database. I want to use Erlang to replace this bunch of files by mnesia tables.
My intention is to open Marez as a port, send the input that it needs via StdIn and get the answer back from StdOut.
Since I also want to substitute all file accesses from Marez by mnesia accesses it would be cool if I could open more pipes than only StdIn, StdOut and StdErr. In this way I could replace in Marez all OPEN file by OPEN pipe.
Otherwise I would have to multiplex all these accesses to StdIn and StdOut.
mit freundlichen Grüßen / with kind regards
Silvester Rößner
-------------------------------------------------------------------------------------------------------
Carl Zeiss Vision GmbH
Corporate Technology
Solution Architect Software Application Development
S i l v e s t e r R ö ß n e r
phone: +49 7361 591 831
fax: +49 7361 591 498
mailto: <mailto:silvester.roessner@REDACTED> silvester.roessner@REDACTED
Carl Zeiss Vision GmbH, Turnstr. 27, 73430 Aalen
Geschäftsführer: Dr. Raymund Heinen, Thomas Radke
Sitz der Gesellschaft: 73430 Aalen, Deutschland
Amtsgericht Ulm, HRB 501574, USt.-IdNr.: DE 237 102 722
-------------------------------------------------------------------------------------------------------
This message is intended for a particular addressee only and
may contain business or company secrets. If you have received
this email in error, please contact the sender and delete the
message immediately. Any use of this email, including saving,
publishing, copying, replication or forwarding of the message
or the contents is not permitted.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080808/db476216/attachment.htm>
More information about the erlang-questions
mailing list