Serial port driver for Erlang on Windows?

Tomas Pihl tomas.pihl@REDACTED
Mon Jan 8 07:42:59 CET 2001

On Fri, 5 Jan 2001, Peter Andersson wrote:

> Hi everyone,
> Johan Bevemyr has written a serial port driver for Erlang on UNIX (contributed
> to Has anyone done something similar for Windows? If not, I would
> still be grateful for any info or pointers that you could provide me with on
> this subject. I want to be able to run an Erlang application (using the UNIX
> serial port driver) on Windows as well, but I don't have any experience of
> low-level Windows programming. (Is Johan's ANSI C driver easily ported? How
> would e.g. opening and connecting to a /dev/ttya,b,... device in Unix be
> accomplished in Windows using the Com1,2,... abstractions?). 

You could try cygwin ( I've used it
for "porting" a *BSD application to Windows with good results. This
particular application of mine included serialport access and all I did
was to replace the /dev/tty? with /dev/com? in order to have it working
on Windows. I was actually quite impressed with it beeing so easy.

One thing I noticed though was I couldn't get the opening of the same
port twice to work, ie. when you want to have one filedescriptor for
reading and another one for writing using the same port. Don't know if
this is a Windows restriction or a cygwin problem.

Tomas Pihl

More information about the erlang-questions mailing list