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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!p9g2000vbl.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Preferred way to do binray I/O on standard input/output stream Date: Sat, 24 Oct 2009 15:07:29 -0700 (PDT) Organization: http://groups.google.com Message-ID: <8ec042f2-5308-4a7c-8f48-a6b72ec8feba@p9g2000vbl.googlegroups.com> NNTP-Posting-Host: 77.198.58.13 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1256422049 14458 127.0.0.1 (24 Oct 2009 22:07:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 24 Oct 2009 22:07:29 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p9g2000vbl.googlegroups.com; posting-host=77.198.58.13; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8779 Date: 2009-10-24T15:07:29-07:00 List-Id: 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.