From: Dmitry A. Kazakov on
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
From: Randy Brukardt on
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(a)dmitry-kazakov.de> wrote in message
news:tifgjrvt4uik$.sf4ffwrghzp3.dlg(a)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


From: Larry Kilgallen on
In article <tifgjrvt4uik$.sf4ffwrghzp3.dlg(a)40tude.net>, "Dmitry A. Kazakov" <mailbox(a)dmitry-kazakov.de> writes:

> Some operating systems have case-insensitive file names.

VMS has case-blind file processing or case-sensitive file processing
depending on the individual disk volume configuration and on the
characteristics of the process doing the accessing.

Any implementation should depend on the OS primitive functions that
are provided.
From: I. Levashew on
Larry Kilgallen �����:

> VMS has case-blind file processing or case-sensitive file processing
> depending on the individual disk volume configuration and on the
> characteristics of the process doing the accessing.

That's right. There is a more widespread example of such an OS : Mac OS
X. User is free to choose between 4 variants of HFS+: w/wo
case-sensitivity; and w/wo journaling. Additional partitions can also be
formatted in FAT32 or UFS.