<div dir="ltr"><div dir="ltr">Hi,<br><br>I correct my previous post, sorry, regarding {error, eisdir}<br><br>I'm on OTP/19.<br><br>From OTP/22:<br>  OTP-11462    Application(s): erts<br>               It is now possible to open device files and FIFOs with<br>               file:open/2.<br><br>My bad!<br><br>Thanks<br>Best Regards,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 13 août 2020 à 10:29, Papa Tana <<a href="mailto:papa.tana101@gmail.com">papa.tana101@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Ok, then it's kind of a device file, and of course it is, so stupid from me, because my VM can boot and attach to it :-/<br><br>trying traditional way gives me {error,eisdir}:<br><br>> file:open<br>> file:read_file<br><br>As a perfect workaround, as long as open_port is working (I'm using OTP/19), I will keep it:<br><a href="http://erlang.org/download/otp_src_19.0.readme" target="_blank">http://erlang.org/download/otp_src_19.0.readme</a><br><br><b>But I don't know for the latest OTP/23 and for the future OTP release, because I see a lot of assert that it will be removed?<br>Can one confirm that please?<br></b><br>Best Regards,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 12 août 2020 à 22:41, Łukasz Niemier <<a href="mailto:lukasz@niemier.pl" target="_blank">lukasz@niemier.pl</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> 3/ Anyway, I hope I did not misunderstood, but I was undesrtanding that it was feasible to connect to an existing named pipe "allocated by mkfifo" via gen_udp/gen_tcp?<br>
> because for this, I always fail, since the named pipe has the same name as my unix-domain socket.<br>
> <br>
> {error, eaddrinuse} when listen , {error, econnrefused} when send<br>
> <br>
> ==> So my question is, How do you connect to an existing named pipe allocated by mkfifo, via gen_udp/gen_tcp, not using open_port?<br>
<br>
You treat named pipe as a **file** not socket. So you would use "regular" file and io functions for opening and reading content of file.<br>
<br>
> PS: I will try to understand socat and cap_net_raw as well later on :-p<br>
<br>
Socat is just a utility to pipe data to/from the sockets and cap_net_raw is needed when you do not want to run VM (or ports) as root.<br>
<br>
--<br>
<br>
Łukasz Niemier<br>
<a href="mailto:lukasz@niemier.pl" target="_blank">lukasz@niemier.pl</a><br>
<br>
</blockquote></div></div>
</blockquote></div></div>