From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c64c5909c07a2300 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-09 22:16:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: Michael Bode Newsgroups: comp.lang.ada Subject: Re: Ada way to read/write to character file Date: 10 Jan 2002 07:17:06 +0100 Organization: Organized? Me? Sender: mb@jupiter.solar.system Message-ID: References: <3C3CD8EF.7736AB1A@worldnet.att.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.t-online.com 1010643282 04 8292 GA+cTkSTS4ADsv 020110 06:14:42 X-Complaints-To: abuse@t-online.com X-Sender: 320025674319-0001@t-dialin.net User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:18726 Date: 2002-01-10T07:17:06+01:00 List-Id: James Rogers 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.