comp.lang.ada
 help / color / mirror / Atom feed
From: Michael Bode <m.g.bode@web.de>
Subject: Re: Ada way to read/write to character file
Date: 10 Jan 2002 07:17:06 +0100
Date: 2002-01-10T07:17:06+01:00	[thread overview]
Message-ID: <m3ofk2ivbx.fsf@jupiter.solar.system> (raw)
In-Reply-To: 3C3CD8EF.7736AB1A@worldnet.att.net

James Rogers <jimmaureenrogers@worldnet.att.net> writes:

> Unix likes to pretend that all devices are programmatically 
> equivalent to files. This is done through some conventions and
> odd mappings between files and device drivers. Note that this is
> operating system specific, not language specific. 

Windows does the same thing. You have to open("/dev/ttyS*") (Unix) or
CreateFile("COM*") (Windows), then you read() (Unix) or ReadFile()
(Windows) and write() / WriteFile() and then your close() (Unix) or
CloseHandle() (Windows). After the open() you can set the comm
parameters or you use the currently set parameters. In the latter case
it's exactly like a normal file and you could set the parameters by a
standard OS command before your program starts. The only difference is
how the parameter setting is done.

Maybe there are 300 other OSses where this is handled different, but
as far as PCs are concerned if you have Windows and Unix agree on
something there is not much left to differ. At least since Apple has
gone BSD it should be the same there, if the have RS232 at all.



  reply	other threads:[~2002-01-10  6:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-05 12:01 Ada way to read/write to character file Michael Bode
2002-01-07 15:13 ` Alfred Hilscher
2002-01-09  0:04   ` Nick Roberts
2002-01-09  2:12     ` tmoran
2002-01-09  6:25       ` Michael Bode
2002-01-09 16:12         ` Georg Bauhaus
2002-01-09 20:38           ` Michael Bode
2002-01-09 23:57             ` James Rogers
2002-01-10  6:17               ` Michael Bode [this message]
2002-01-10 23:13             ` Georg Bauhaus
2002-01-09 12:11       ` Nick Roberts
2002-01-09 14:17         ` Ted Dennison
2002-01-11  0:19           ` Nick Roberts
2002-01-12 16:01             ` Michael Bode
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox