<div dir="ltr">You can make simple shell or other wrappers over named pipes and use it as other ports.<br><br><div class="gmail_quote">2008/8/8 Roessner, Silvester <span dir="ltr"><<a href="mailto:silvester.roessner@vision.zeiss.com">silvester.roessner@vision.zeiss.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div><font face="Arial" size="2"><span>Hello,</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>can I open a port so
it communicates via a named pipe or an unnamed pipe other than StdIn and StdOut?
</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>The documentation
says</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial monospaced for SAP" size="2">open_port(PortName,
PortSettings) -> port()</font></div>
<div><font face="Arial monospaced for SAP" size="2"></font> </div>
<div><font face="Arial monospaced for SAP" size="2">PortName = {spawn, Command} |
{fd, In, Out}</font></div>
<div><font><font face="Arial monospaced for SAP" size="2"></font></font> </div>
<div><font><font face="Arial monospaced for SAP" size="2">{fd, In, Out} <br>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.<br></font></font></div>
<div><font><font face="Arial monospaced for SAP"><span><font face="Arial" size="2">But I haven't
found details on {fd, In, Out} and how I could open a new
fd.</font></span></font></font></div><font face="Arial" size="2"><span></span></font>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>Backgroud:</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>We have
a legacy Fortran program (called Marez) that opens many <font face="Arial" size="2"><span>files and uses this files as a
database. </span></font></span></font><font face="Arial" size="2"><span>I want to use Erlang to replace this bunch of files by
mnesia tables.</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>My intention is to
open Marez as a port, send the input that it needs via StdIn and get
the answer back from StdOut.</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>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.</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>Otherwise I would
have to multiplex all these accesses to StdIn and StdOut.</span></font></div>
<div><font face="Arial" size="2"></font> </div>
<div>
<p align="left"><span style="font-size: 10pt; font-family: Arial;">mit freundlichen Grüßen / <span>with</span> <span>kind</span> <span>regards</span></span></p>
<p><font face="Arial" size="2"></font> </p>
<p><span style="font-size: 10pt; font-family: Arial;">Silvester
Rößner<br></span></p>
<div><span><font face="Arial" size="2"></font></span> </div>
<div><span><font face="Arial" size="2">-------------------------------------------------------------------------------------------------------</font></span></div>
<div><span><font face="Arial" size="2">Carl Zeiss Vision
GmbH</font></span></div>
<div><span><font face="Arial" size="2">Corporate
Technology</font></span></div>
<div><span><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Solution <span>Architect</span> Software <span>Application</span>
<span>Development</span></span></font></span></div>
<div><span><font face="Arial" size="2"></font></span> </div>
<div><span><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">S i l v e s t e r R ö ß
n e r</span></font></span></div>
<div><span><font face="Arial" size="2"></font></span> </div>
<div><span><font face="Arial" size="2">phone: +49 7361 591
831</font></span></div>
<div><span><font face="Arial" size="2">fax: +49 7361 591 498</font></span></div>
<div><span><font face="Arial" size="2">mailto: </font><a title="blocked::mailto:vorname.name@vision.zeiss.com" href="mailto:silvester.roessner@vision.zeiss.oe" target="_blank"><font title="blocked::mailto:vorname.name@vision.zeiss.com" face="Arial" size="2"></font></a><font title="blocked::mailto:vorname.name@vision.zeiss.com" face="Arial" size="2"><a href="mailto:silvester.roessner@vision.zeiss.org" target="_blank">silvester.roessner@vision.zeiss.org</a></font></span></div>
<div><span><font face="Arial" size="2"></font></span> </div>
<div><span>
<p><font face="Arial" size="2">Carl Zeiss Vision GmbH, Turnstr. 27, 73430
Aalen<br>Geschäftsführer: <span>Dr. Raymund
Heinen, </span><span>Thomas Radke</span><br>Sitz der
Gesellschaft: 73430 Aalen, Deutschland<br>Amtsgericht Ulm, HRB 501574,
USt.-IdNr.: DE 237 102 722</font></p>
<p></p></span><span><font face="Arial" size="2">-------------------------------------------------------------------------------------------------------</font></span></div></div>
<div> </div><br>
<div>
<p style="margin: 5pt 0cm;"><span style="font-size: 10pt; font-family: Arial;">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.</span></p>
<p> </p>
</div>
<br></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br></blockquote></div><br><br clear="all"><br>-- <br>--Hynek (Pichi) Vychodil<br>
</div>