From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a05:620a:45a8:b0:762:3d49:c90e with SMTP id bp40-20020a05620a45a800b007623d49c90emr15926qkb.6.1688231726403; Sat, 01 Jul 2023 10:15:26 -0700 (PDT) X-Received: by 2002:a25:1ed6:0:b0:bff:4ed0:63f6 with SMTP id e205-20020a251ed6000000b00bff4ed063f6mr46155ybe.7.1688231725968; Sat, 01 Jul 2023 10:15:25 -0700 (PDT) Path: eternal-september.org!news.eternal-september.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 1 Jul 2023 10:15:25 -0700 (PDT) Injection-Info: google-groups.googlegroups.com; posting-host=98.59.238.112; posting-account=oHOvdQoAAACYgyEBjgPNvKFOGxg8pNns NNTP-Posting-Host: 98.59.238.112 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <41a5cad2-b5ca-4996-b057-e1ae8b27f526n@googlegroups.com> Subject: Using "pure" (?) Ada, how to determine whether a file is a "text" file, not a binary? From: Kenneth Wolcott Injection-Date: Sat, 01 Jul 2023 17:15:26 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 1877 Xref: news.eternal-september.org comp.lang.ada:65393 List-Id: Hi; Another very beginner question here... Using "pure" (?) Ada, how to determine whether a file is a "text" file, not a binary? Kind of like using the UNIX/Linux "file" command, but doesn't have to be comprehensive (yet). Something like the Perl "-T" feature. On the other hand, if there already exists an Ada implementation of the UNIX "file" command as a library, could you point me to that? As a side question, how does one read "binary" files in Ada? A UNIX/Linux use case for the previous sentence is the concatenation of two (or more) "binary" files that were created using the UNIX/Linux "split" command. So I'd be interested in emulating the UNIX "cat" command for "binary" files. These are just personal experiments for learning how to do all kinds of Ada I/O... Thanks, Ken Wolcott