From: "Hibou57 (Yannick Duchêne)" <yannick_duchene@yahoo.fr>
Subject: Preferred way to do binray I/O on standard input/output stream
Date: Sat, 24 Oct 2009 15:07:29 -0700 (PDT)
Date: 2009-10-24T15:07:29-07:00 [thread overview]
Message-ID: <8ec042f2-5308-4a7c-8f48-a6b72ec8feba@p9g2000vbl.googlegroups.com> (raw)
Hello boys and girls,
There is no kind of binary mode vs text mode flags with Ada stream/
file IO, as it there are with C. And then, C files are not typed,
while Ada files/streams are, thus, this will not make any sense to
simply talk about binary I/O with Ada. So let simply talk about non-
text I/O from and to standard input/output.
When some people need this, what is the typical preferred to do so ?
Using a custom file type which rely on the OS ? (one for each OS if it
is to be built for multiple platforms)
Simply use characters with Text_IO and then do a character code
interpretation as if it was binary data ?
Other ways ?
The first way, seems the more formal, but requires more work, and
probably a lot of testing to ensure the custom file type
implementation does not contain any error.
The second way seems to be safer in some way (relies on a standard
package), but does not seems safe in the way nothing can ensure no
data will not be lost or modified (as it is primarily Text_IO).
If I missed something in the standard packages which allow this to be
done directly, I simply apologize for this topic.
Have a nice time all
Y.
next reply other threads:[~2009-10-24 22:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-24 22:07 Hibou57 (Yannick Duchêne) [this message]
2009-10-24 22:57 ` Preferred way to do binray I/O on standard input/output stream Jeffrey R. Carter
2009-10-24 23:22 ` Hibou57 (Yannick Duchêne)
2009-10-27 0:34 ` Hibou57 (Yannick Duchêne)
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