comp.lang.ada
 help / color / mirror / Atom feed
From: Chris Townley <news@cct-net.co.uk>
Subject: Re: Using "pure" (?) Ada, how to determine whether a file is a "text" file, not a binary?
Date: Sun, 2 Jul 2023 02:08:17 +0100	[thread overview]
Message-ID: <u7qim2$2tdvh$1@dont-email.me> (raw)
In-Reply-To: <48b33023-a38e-4ccc-855e-fe6de7b12ea5n@googlegroups.com>

On 01/07/2023 22:50, Kenneth Wolcott wrote:
> On Saturday, July 1, 2023 at 2:39:06 PM UTC-7, Keith Thompson wrote:
>> Kenneth Wolcott writes:
>>> On Saturday, July 1, 2023 at 1:39:30 PM UTC-7, Jeffrey R.Carter wrote:
>>>> On 2023-07-01 19:15, Kenneth Wolcott wrote:
>> [...]
>>>> For example, if a text file is one in which all the characters, except line
>>>> terminators, are graphic characters, then it should be clear how to determine
>>>> whether a file meets that definition of a text file.
>>>
>>> I think that is the definition that I'm going to pursue as the
>>> simplest and effective definition.
>> Think about how you want to handle tab characters (non-graphic but
>> common in some text) and carriage return characters (non-graphic but
>> part of a line terminator for Windows-style text files).
>>
>> Also think about the various ways of representing text: ASCII, Latin-1,
>> UTF-8, UTF-16, etc.
> 
> Thanks, Keith!
> 
> It looks like just need to more carefully examine the existing Ada I/O packages and experiment with the possibilities...
> 
> Ken

Maybe worth looking at the unix file utility, docs and source are available
-- 
Chris

  reply	other threads:[~2023-07-02  1:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-01 17:15 Using "pure" (?) Ada, how to determine whether a file is a "text" file, not a binary? Kenneth Wolcott
2023-07-01 20:39 ` Jeffrey R.Carter
2023-07-01 20:54   ` Kenneth Wolcott
2023-07-01 21:39     ` Keith Thompson
2023-07-01 21:50       ` Kenneth Wolcott
2023-07-02  1:08         ` Chris Townley [this message]
2023-07-02  1:48           ` Kenneth Wolcott
replies disabled

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