comp.lang.ada
 help / color / mirror / Atom feed
* Preferred way to do binray I/O on standard input/output stream
@ 2009-10-24 22:07 Hibou57 (Yannick Duchêne)
  2009-10-24 22:57 ` Jeffrey R. Carter
  0 siblings, 1 reply; 7+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2009-10-24 22:07 UTC (permalink / 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.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-10-27 16:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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)
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

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