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=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a05:620a:45a8:b0:765:94ad:379d with SMTP id bp40-20020a05620a45a800b0076594ad379dmr18763qkb.6.1688262536422; Sat, 01 Jul 2023 18:48:56 -0700 (PDT) X-Received: by 2002:a17:902:c246:b0:1a9:8f00:bf6e with SMTP id 6-20020a170902c24600b001a98f00bf6emr4956446plg.3.1688262536170; Sat, 01 Jul 2023 18:48:56 -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 18:48:55 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=98.59.238.112; posting-account=oHOvdQoAAACYgyEBjgPNvKFOGxg8pNns NNTP-Posting-Host: 98.59.238.112 References: <41a5cad2-b5ca-4996-b057-e1ae8b27f526n@googlegroups.com> <87edlrxqfd.fsf@nosuchdomain.example.com> <48b33023-a38e-4ccc-855e-fe6de7b12ea5n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <74f92ce6-851f-4074-8f3a-549b64555b18n@googlegroups.com> Subject: Re: Using "pure" (?) Ada, how to determine whether a file is a "text" file, not a binary? From: Kenneth Wolcott Injection-Date: Sun, 02 Jul 2023 01:48:56 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2972 Xref: news.eternal-september.org comp.lang.ada:65399 List-Id: On Saturday, July 1, 2023 at 6:08:21=E2=80=AFPM UTC-7, Chris Townley wrote: > On 01/07/2023 22:50, Kenneth Wolcott wrote:=20 > > On Saturday, July 1, 2023 at 2:39:06=E2=80=AFPM UTC-7, Keith Thompson w= rote:=20 > >> Kenneth Wolcott writes:=20 > >>> On Saturday, July 1, 2023 at 1:39:30=E2=80=AFPM UTC-7, Jeffrey R.Cart= er wrote:=20 > >>>> On 2023-07-01 19:15, Kenneth Wolcott wrote:=20 > >> [...]=20 > >>>> For example, if a text file is one in which all the characters, exce= pt line=20 > >>>> terminators, are graphic characters, then it should be clear how to = determine=20 > >>>> whether a file meets that definition of a text file.=20 > >>>=20 > >>> I think that is the definition that I'm going to pursue as the=20 > >>> simplest and effective definition.=20 > >> Think about how you want to handle tab characters (non-graphic but=20 > >> common in some text) and carriage return characters (non-graphic but= =20 > >> part of a line terminator for Windows-style text files).=20 > >>=20 > >> Also think about the various ways of representing text: ASCII, Latin-1= ,=20 > >> UTF-8, UTF-16, etc.=20 > >=20 > > Thanks, Keith!=20 > >=20 > > It looks like just need to more carefully examine the existing Ada I/O = packages and experiment with the possibilities...=20 > >=20 > > Ken > Maybe worth looking at the unix file utility, docs and source are availab= le=20 Thank you, Chris. I have just downloaded the source code for the UNIX/Linus file command and = am browsing around... Thanks, Ken=20