[erlang-questions] Unix domain sockets

Daniel Goertzen <>
Tue Mar 31 15:34:46 CEST 2009


Unfortunately, the documentation implies that this is not allowed:

eisdir The named file is not a regular file. It may be a directory, a fifo,
or a device.
I'm a little dismayed at this; I was planning on using a char driver soon by
opening it as a file and then attaching a port to it with
open_port({fd,...).  I guess I will be doing it a different way...  Likely a
whole port program.

Dan.

On Mon, Mar 30, 2009 at 7:04 PM, Sargun Dhillon <> wrote:

> Apparently this doesn't work for character or block devices, see here:
> [running beam as root]
> 1> FOut = file:open("/dev/net/tun", [read, write]).
> {error,eisdir}
> 2> FOut1 = file:open("/dev/net/tun", [read, write, raw]).
> {error,eisdir}
> 3> FOut3 = file:open("/dev/sda", [read, write, raw]).
> {error,eisdir}
> 4> FOut3 = file:open("/dev/sda", [read, write]).
> {error,eisdir}
>
> lucifer ~ # ls -l /dev/net/tun
> crw-rw-rw- 1 root root 10, 200 Mar 30 16:51 /dev/net/tun
> lucifer ~ # ls -l /dev/sda
> brw-r----- 1 root disk 8, 0 Mar 30 09:27 /dev/sda
>
> Any ideas on how to read this? Do I need to break out a port driver?
>
> 2009/3/8 Antoine Koener <>:
> > And what about the support for NamedPipes on windows ?
> > Anyone with experience ?
> > On Fri, Mar 6, 2009 at 3:24 AM, Richard Andrews <>
> wrote:
> >>
> >> IIRC there was a UNIX socket project in jungerl too.
> >>
> >>
> >>
> >>
> >> > There's an example driver for unix domain sockets under
> >> > $OTP_ROOT/lib/kernel/examples/uds_dist/
> >> >
> >> > (It's still there in R13A-0, BTW.)
> >> >
> >> > It used to be documented in the Interoperability Tutorial, but
> >> > I think they've switched to a different example now.
> >>
> >>
> >>      Stay connected to the people that matter most with a smarter inbox.
> >> Take a look http://au.docs.yahoo.com/mail/smarterinbox
> >> _______________________________________________
> >> erlang-questions mailing list
> >> 
> >> http://www.erlang.org/mailman/listinfo/erlang-questions
> >
> >
> >
> > --
> >
> > http://easyerl.blogspot.com/
> > http://www.open-tools.org/
> >
> >
> > _______________________________________________
> > erlang-questions mailing list
> > 
> > http://www.erlang.org/mailman/listinfo/erlang-questions
> >
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



-- 
Daniel Goertzen
-----------------
work email: 
work phone: 1 443 303 8525
work sip: 
-----------------
mobile: 1 204 470 8360
-----------------
home email: 
home phone: 1 204 272 6149
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090331/95c4e1b1/attachment.html>


More information about the erlang-questions mailing list