comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: xor
Date: Thu, 29 Mar 2012 09:43:53 +0200
Date: 2012-03-29T09:43:53+02:00	[thread overview]
Message-ID: <2k5907ol7wx$.d3tl2imoggc4.dlg@40tude.net> (raw)
In-Reply-To: tdadna1MV6uj5O7SnZ2dnUVZ_jidnZ2d@earthlink.com

On Wed, 28 Mar 2012 16:49:14 -0400, Dennis Lee Bieber wrote:

> 	The Stream_IO system (which I've never used myself) is an attempt to
> map Ada I/O onto a UNIX-style "stream" and allow for putting diverse
> element types into a single stream.

Stream_IO provides an implementation of Ada.Streams backed by files. There
are streams backed by memory, by sockets etc.

Considering Stream_IO, as Randy already pointed out, it is likely the most
efficient way to handle files.

> I believe that, for example, writing
> a "string" will result in a length value first, then <length>
> characters.

Yes, if String'Output is used. When String'Write is, then no bounds are
written.

> 	I believe my last job mostly used Text_IO in conjunction with 'image
> and 'value attributes to convert between text file and internal binary.

In many cases Stream_IO is a better choice over Text_IO, e.g. if you want
to handle file encoding, line endings etc.

Ideally, Text_IO should do it for you. But in reality, it should actually
be Wide_Wide_IO, and it is not to expect that its implementation would
really talk to the OS in order to determine the encoding and that the OS is
capable to do it properly, and the Wide_Wide_IO would really convert
anything as it reads and writes. It is also not to expect that
LF/CR/EOF-mess would be handled properly.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  parent reply	other threads:[~2012-03-29  7:45 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-25 14:28 xor Michael Moeller
2012-03-25 14:01 ` xor Niklas Holsti
2012-03-25 15:16   ` xor Michael Moeller
2012-03-25 19:05     ` xor Dmitry A. Kazakov
2012-03-27 20:31       ` xor Michael Moeller
2012-03-25 19:26     ` xor Niklas Holsti
2012-03-27 20:09       ` xor Michael Moeller
2012-03-27 19:44         ` xor Dmitry A. Kazakov
2012-03-27 21:16           ` xor Michael Moeller
2012-03-27 21:14             ` xor Simon Wright
2012-03-27 22:56               ` xor Michael Moeller
2012-03-27 22:03             ` xor Georg Bauhaus
2012-03-27 23:50               ` xor Michael Moeller
     [not found]                 ` <bbedne9wdofZyu_SnZ2dnUVZ_hydnZ2d@earthlink.com>
2012-03-28 12:18                   ` xor Michael Moeller
2012-03-28 12:48                     ` xor Georg Bauhaus
2012-03-28 15:23                       ` xor Michael Moeller
2012-03-28 15:58                         ` xor Niklas Holsti
2012-03-28 17:28                           ` xor Michael Moeller
2012-03-28 23:25                           ` xor Randy Brukardt
2012-03-29  5:17                             ` xor Niklas Holsti
2012-03-29 23:41                               ` xor Randy Brukardt
2012-03-30 21:53                                 ` xor Niklas Holsti
     [not found]                         ` <jtmdnfjWWsUYoO7SnZ2dnUVZ_gSdnZ2d@earthlink.com>
2012-03-28 17:44                           ` xor Michael Moeller
2012-03-28 14:07                     ` xor Dmitry A. Kazakov
2012-03-28 16:16                       ` xor Michael Moeller
2012-03-28 16:08                         ` xor Dmitry A. Kazakov
2012-03-28 17:36                           ` xor Michael Moeller
     [not found]                             ` <tdadna1MV6uj5O7SnZ2dnUVZ_jidnZ2d@earthlink.com>
2012-03-28 21:48                               ` xor Georg Bauhaus
2012-03-29  7:43                               ` Dmitry A. Kazakov [this message]
2012-03-29  7:49                               ` xor Simon Wright
2012-03-27 21:28           ` xor Georg Bauhaus
2012-03-27 19:50         ` xor Randy Brukardt
2012-03-27 21:44           ` xor Michael Moeller
2012-03-27 22:01             ` xor Georg Bauhaus
2012-03-27 20:13         ` xor Jeffrey Carter
replies disabled

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