comp.lang.ada
 help / color / mirror / Atom feed
* Yet another problem with Ada.Directories
@ 2007-11-26 14:10 Dmitry A. Kazakov
  2007-11-27  2:07 ` Randy Brukardt
  2007-11-27  7:11 ` Larry Kilgallen
  0 siblings, 2 replies; 4+ messages in thread
From: Dmitry A. Kazakov @ 2007-11-26 14:10 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Yet another problem with Ada.Directories
  2007-11-26 14:10 Yet another problem with Ada.Directories Dmitry A. Kazakov
@ 2007-11-27  2:07 ` Randy Brukardt
  2007-11-27  7:11 ` Larry Kilgallen
  1 sibling, 0 replies; 4+ messages in thread
From: Randy Brukardt @ 2007-11-27  2:07 UTC (permalink / raw)


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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Yet another problem with Ada.Directories
  2007-11-26 14:10 Yet another problem with Ada.Directories Dmitry A. Kazakov
  2007-11-27  2:07 ` Randy Brukardt
@ 2007-11-27  7:11 ` Larry Kilgallen
  2007-12-20 10:37   ` I. Levashew
  1 sibling, 1 reply; 4+ messages in thread
From: Larry Kilgallen @ 2007-11-27  7:11 UTC (permalink / raw)


In article <tifgjrvt4uik$.sf4ffwrghzp3.dlg@40tude.net>, "Dmitry A. Kazakov" <mailbox@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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Yet another problem with Ada.Directories
  2007-11-27  7:11 ` Larry Kilgallen
@ 2007-12-20 10:37   ` I. Levashew
  0 siblings, 0 replies; 4+ messages in thread
From: I. Levashew @ 2007-12-20 10:37 UTC (permalink / raw)


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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-20 10:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-26 14:10 Yet another problem with Ada.Directories Dmitry A. Kazakov
2007-11-27  2:07 ` Randy Brukardt
2007-11-27  7:11 ` Larry Kilgallen
2007-12-20 10:37   ` I. Levashew

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