Can anyone recommend a way to treat the output from an open_port call as an io_device() instead of as chunks of data that are delivered to the port's controlling process and fetched via receive?<br><br>What I want is to use file:read/2 to read from the external process. The reason is that data going TO the process already has 4 byte length headers on it, so I can't use {packet, 4}. The data coming FROM the process also has the headers so I'll need to do length header management myself which is difficult (and inefficient) when dealing with chunked data.<br>
<br>Alternatively, is there a way to just create an in-memory io_device() that I can use as a fifo? Then I could write the chunked data to the fifo and read off the other side. I tried using a posix fifo file but file:open/2 will not open it because of {error,eisdir}. It looks like I can open the fifo as a port but that leaves me with the same exact problem.<br>
<br>I've looked all over the docs and asked in #erlang but I've seen no way to create a simple pipe that I can use for this purpose!<br><br>Tom Preston-Werner<br><a href="http://github.com/mojombo">github.com/mojombo</a><br>
<br><br>