<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi!<br>
On 01/25/2013 07:13 PM, Heinz Nikolaus Gies wrote:<br>
</div>
<blockquote
cite="mid:3D11C3B4-3231-44DA-8F3D-8FD8A414BA8D@licenser.net"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Hi everyone,
<div>I am trying to get Erlang to talk to (solarises) zlogin. I
figured, open_port would be the logical step to do that BUT it
dies horribly the command I run is:</div>
<div><br>
</div>
<div>open_port({spawn, "/usr/sbin/zlogin -C
8e3b630b-d18a-4047-bad3-600b17d9ef46"}, [use_stdio]).</div>
<div><br>
</div>
<div>also experimented with other port options but they don't'
really make a difference safe for nouse_stdio which replaces the
Erlang console with the zlogin one (which doesn't help much ;)</div>
<div><br>
</div>
<div>the error I get from zlogin is:</div>
<div><br>
</div>
<div>
<div>(<a moz-do-not-send="true"
href="mailto:chunter@192.168.0.52">chunter@192.168.0.52</a>)8>
open_port({spawn, "/usr/sbin/zlogin -C
8e3b630b-d18a-4047-bad3-600b17d9ef46"}, [use_stdio]).</div>
<div>zlogin: failed to get user terminal settings: Invalid
argument</div>
<div>zlogin: failed to set stdin pty to raw mode: Invalid
argument</div>
</div>
<div><br>
</div>
<div>I've tracked down that a bit further into the zlogin code and
it seems to be related to a call to <span style="font-family:
Menlo; font-size: 11px; ">tcgetattr(fd, &term) </span>in
the code which fails with the open_socket created connection.</div>
<div><br>
</div>
<div>I'm a bit at a loss here what to do next sadly, any advice?</div>
<div><br>
</div>
</blockquote>
It seems zlogin expects a terminal as stdin, but if you open_port,
stdin for the program will be a pipe, which you cannot do tcgetattr
on. You will need to either find an option to zlogin that expects
input from something not a terminal, or create a wrapper program
that creates a pty , starts zlogin and forwards data from/to the pty
and the pipe (which would be some hacking, but not impossible,
that's basically what run_erl does, but to/from a named pipe -
possibly there's already a program out there doing that, maybe
someone on the list can enlighten us :))<br>
<blockquote
cite="mid:3D11C3B4-3231-44DA-8F3D-8FD8A414BA8D@licenser.net"
type="cite">
<div>Regards,</div>
<div>Heinz</div>
<br>
</blockquote>
Cheers,<br>
/Patrik<br>
<blockquote
cite="mid:3D11C3B4-3231-44DA-8F3D-8FD8A414BA8D@licenser.net"
type="cite">
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
<br>
</body>
</html>