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 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 15:57:27 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!newspump.sol.net!wn1feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3C3CD8EF.7736AB1A@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada way to read/write to character file References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 09 Jan 2002 23:57:26 GMT NNTP-Posting-Host: 12.86.38.48 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1010620646 12.86.38.48 (Wed, 09 Jan 2002 23:57:26 GMT) NNTP-Posting-Date: Wed, 09 Jan 2002 23:57:26 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:18715 Date: 2002-01-09T23:57:26+00:00 List-Id: Michael Bode wrote: > > As far as I have seen all those devices use quite simple textual > structures i.e. normal ASCII printable characters, CR, LF and maybe > ESC. I'm not 100% sure as this is my first real Ada program, but I > would expect no problems with this and Ada.Text_IO. > > For your other points: all that may be true in general and therefore > must be considered in a true standard package. But for my small world > of Windows and Linux PCs Ada.Text_IO with a r/w mode would work. But > it is not there and I wanted to make sure that I had not overlooked > something. It was not really a big deal to write my own package and I > had some practice in writing C bindings to OS functions too. My experience with RS-232 serial I/O is that this has absolutely NO relationship with file I/O. To make RS-232 I/O work you must implement an RS-232 driver. That driver must set the appropriate bits in the RS-232 control register on your hardware to either read or write data. Those bit settings result in a corresponding set of bit responses from the device, to indicate whether or not the device is ready for the read or write. Finally, you must read or write the byte(s), one bit at a time. Communicating with the RS-232 driver can be abstracted to a set of "put" and "get" procedures, but those procedures will be part of your RS-232 driver definition, and not related to Ada.Text_IO. 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. Jim Rogers Colorado Springs, Colorado USA