comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Yet another problem with Ada.Directories
Date: Mon, 26 Nov 2007 20:07:25 -0600
Date: 2007-11-26T20:07:25-06:00	[thread overview]
Message-ID: <fiftu9$mdo$1@jacob-sparre.dk> (raw)
In-Reply-To: tifgjrvt4uik$.sf4ffwrghzp3.dlg@40tude.net

I have an action item to address various perceived shortcomings of the
Ada.Directories package. If you want additional issues to be considered, you
need to post your ideas to the Ada-Comment mailing list, so that they get
considered.

I know that case sensitivity is one issue that is explicitly covered by the
(empty) AI. ARG discussion pointed out that the primary purpose of
Ada.Directories is to make it reasonable to portably construct new file
names out of parts of others (comparisons of existing names were not a
goal). But even that needs some knowledge of case sensitivity (you don't
want to construct names differing only by case on Windows).

In one sense, there is no solution needed: portable applications can always
construct names that differ by more than just case, and that will work on
all systems (that I know of).

In any case, file name processing is a very complex area, and one that
cannot be handled (completely) by simplistic solutions (like the one in
Ada.Directories). Comparisons would have to deal with Unicode file names,
for instance.

                            Randy.

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:tifgjrvt4uik$.sf4ffwrghzp3.dlg@40tude.net...
> Some operating systems have case-insensitive file names. The problem is
> that Ada.Directories does not define file name/path comparisons. Comparing
> names as strings is necessarily OS-dependent.
>
> (Actually making Simple_Name, Base_Name, Full_Name the same string type
> does not look much in Ada way (TM). I would make all them new-String with
> comparison overridden.)
>
> ------------------------
> P.S. In the current GNAT implementation for Windows there is a trick to
> compare names properly. That is to pass all file names through
> Get_Directory / Simple_Name -> Compose before doing String comparison.
That
> would make them lower-case.
>
> -- 
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de





  reply	other threads:[~2007-11-27  2:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-26 14:10 Yet another problem with Ada.Directories Dmitry A. Kazakov
2007-11-27  2:07 ` Randy Brukardt [this message]
2007-11-27  7:11 ` Larry Kilgallen
2007-12-20 10:37   ` I. Levashew
replies disabled

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