<html><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head><body bgcolor="#FFFFFF" text="#000000">Right, there are certainly
ways around it, but the point of this discussion is that it seems to be
a missing piece of functionality that Erlangers cannot do unless they
write C code. It seems like ports are 90% of the way there. I think Mr.
Hedeland represented my points nicely.<br>
<br>
-Anthony<br>
<br>
<blockquote style="border: 0px none;"
cite="mid:CAH+xwdA5pqQL7LbP_o-1yqYN1S0a+imYY9u5bYXTJjkNJKdQaQ@mail.gmail.com"
type="cite">
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px"> <div
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
photoaddress="rtrlists@googlemail.com" photoname="Robert Raschke"
src="cid:part1.08040000.06060903@raynes.me"
name="compose-unknown-contact.jpg" height="25px" width="25px"></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
<a moz-do-not-send="true" href="mailto:rtrlists@googlemail.com"
style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;">Robert Raschke</a></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;">
<font color="#9FA2A5"><span style="padding-left:6px">July 29, 2013
4:16 AM</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody"><div dir="ltr">Hi Anthony,<div><br></div><div>could
Py-interface <a moz-do-not-send="true"
href="http://www.lysator.liu.se/%7Etab/erlang/py_interface/">http://www.lysator.liu.se/~tab/erlang/py_interface/</a>
help with that?</div><div><br></div><div>
Note, I've not used it, so don't know much at all beyond reading that
page. It would probably mean using the Pygments library, rather than
going via the command line pygmentize. You can probably take the
pygmentize source and replace the command line handling with setting up a
Python Node.</div>
<div><br></div><div>Alternatively, and not necessarily very nice,
instead of streaming to pygmentize, write to a file and invoke on that.
You wouldn't even need a port then, you could get away with os:cmd/1 (if
you aren't interested in return codes). But you already know this, I
think.</div>
<div><br></div><div>Robby</div><div><br></div><div>PS Something like
expect for Erlang ports would be pretty cool, though. Not that I'm not
volunteering ;-)</div><div><br></div></div><div class="gmail_extra"><br><br><br></div>
</div>
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px"> <div
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
photoaddress="i@raynes.me" photoname="Anthony Grimes"
src="cid:part2.01050709.05060502@raynes.me" name="postbox-contact.jpg"
height="25px" width="25px"></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
<a moz-do-not-send="true" href="mailto:i@raynes.me"
style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;">Anthony Grimes</a></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;">
<font color="#9FA2A5"><span style="padding-left:6px">July 29, 2013
2:19 AM</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody"><div>Hey Robert.</div><div><br></div><div>I
don't think C nodes help in this case, and they don't solve the general
problem. One of my use cases is talking to pygmentize, which is a
Python program. If I want to do that, I have to write a middleman
program that does the actual communication with this program and talks
to my Erlang program over a socket, or via ports if I make the middleman
program look for some specific sequence of bytes to treat as EOF since I
can't send actual EOF.</div><br><br><br>
</div>
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px"> <div
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
photoaddress="rtrlists@googlemail.com" photoname="Robert Raschke"
src="cid:part1.08040000.06060903@raynes.me"
name="compose-unknown-contact.jpg" height="25px" width="25px"></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
<a moz-do-not-send="true" href="mailto:rtrlists@googlemail.com"
style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;">Robert Raschke</a></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;">
<font color="#9FA2A5"><span style="padding-left:6px">July 29, 2013
2:12 AM</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody"><p>Hi Anthony,</p>
<p>In the past, I've tended to use the port mechanism to simply kick off
a C node, which then allows you to have full control over whatever
communications needs you have.</p>
<p>This obviously only works if you are interfacing with a technology
that will allow you to create C node and use the EI libs in some way.
Not sure if that is the case from what you wrote.</p>
<p>Regards,<br>
Robby</p>
</div>
</blockquote>
</body></html>