comp.lang.ada
 help / color / mirror / Atom feed
From: "Hibou57 (Yannick Duchêne)" <yannick_duchene@yahoo.fr>
Subject: Re: Preferred way to do binray I/O on standard input/output stream
Date: Mon, 26 Oct 2009 17:34:08 -0700 (PDT)
Date: 2009-10-26T17:34:08-07:00	[thread overview]
Message-ID: <0d02cd9f-2cf1-48b6-a10f-6ea84427139d@k4g2000yqb.googlegroups.com> (raw)
In-Reply-To: hc0019$nc4$1@news.tornevall.net

On 24 oct, 23:57, "Jeffrey R. Carter" <spam.jrcarter....@spam.acm.org>
wrote:
> Package Ada.Text_IO.Text_Streams (ARM A.12.2) allows converting
> Ada.Text_IO.File_Type to Stream_Access and reading and writing them through the
> capabilities of streams.
While this seems to work most of times, I meet a malfunction (data not
preserved) if the stream ends with a line-feed (a byte whose value is
10). When it is, this last byte seems to be dropped from the stream,
which cause troubles if the binary format is expecting it. This occurs
only when it exactly ends with this byte, and it is Ok if this byte is
followed by a byte whose value is 0 (as an example). It does not occur
when the stream ends with a byte whose value is that of the carriage-
return (13).

Finally, this does not really turn the stream into a binary stream,
and some interpretations remain.



  parent reply	other threads:[~2009-10-27  0:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-24 22:07 Preferred way to do binray I/O on standard input/output stream Hibou57 (Yannick Duchêne)
2009-10-24 22:57 ` Jeffrey R. Carter
2009-10-24 23:22   ` Hibou57 (Yannick Duchêne)
2009-10-27  0:34   ` Hibou57 (Yannick Duchêne) [this message]
2009-10-27  1:14     ` John B. Matthews
2009-10-27  2:36       ` Hibou57 (Yannick Duchêne)
2009-10-27 16:13         ` John B. Matthews
replies disabled

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