comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Operating System differences and Ada OS independent programming
Date: Mon, 21 Mar 2016 17:04:41 -0500
Date: 2016-03-21T17:04:41-05:00	[thread overview]
Message-ID: <ncpr5p$mnb$1@loke.gir.dk> (raw)
In-Reply-To: dta0fbll6sipc98r88nacm4k9adthj3amn@4ax.com

"Dennis Lee Bieber" <wlfraed@ix.netcom.com> wrote in message 
news:dta0fbll6sipc98r88nacm4k9adthj3amn@4ax.com...
...
> Standard library Directories
> http://www.adaic.org/resources/add_content/standards/05rm/html/RM-A-16.html
> may provide some help, though it appears to lack a "normalize path"
> operation... The compose() operation may allow for building up OS
> compatible paths but is nothing like Python's os.path.join()

There's also Ada.Directories.Hierarchical_File_Names, which adds some of the 
missing parts. (Unfortunately, GNAT missed its addition to Ada 2012, so it 
might not be much help in practice.)

"normalize path" is an attractive idea, but it's pretty much unimplementable 
on Windows. Certain Windows operations will normalize paths, but they don't 
do it consistently. And with the long and short file names on Windows, paths 
*really* need to be normalized. But various Windows documentation says that 
comparing file names should never, ever be done on a Windows system. (It 
turns out that whether two file names are equal depends on the locale 
setting, on the file system of the partition that contains the file, and 
other variables. So it's impossible to compare paths accurately unless you 
know the file system involved -- which makes a general path comparison 
routine impossible [a general routine has to be able to compare paths of 
files that don't necessarily exist, as that might be a preliminary to 
creating a file].

If one follows the advice to avoid comparisons, then there is not much need 
to normalize paths in the first place.

                                   Randy.


  reply	other threads:[~2016-03-21 22:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21 13:18 Operating System differences and Ada OS independent programming ldries46
2016-03-21 15:07 ` gautier_niouzes
2016-03-21 17:24 ` Dennis Lee Bieber
2016-03-21 22:04   ` Randy Brukardt [this message]
2016-03-22  8:43     ` Dmitry A. Kazakov
2016-03-22 11:15       ` G.B.
2016-03-22 13:40         ` Dmitry A. Kazakov
2016-03-22 14:36           ` Stefan.Lucks
2016-03-22 15:08           ` G.B.
2016-03-22 19:06             ` Dmitry A. Kazakov
2016-03-23  8:13         ` gautier_niouzes
2016-03-23  8:38           ` Dmitry A. Kazakov
2016-03-23 15:08             ` G.B.
2016-03-24  8:00               ` Dmitry A. Kazakov
2016-03-24 10:41                 ` G.B.
2016-03-24 10:42                   ` G.B.
2016-03-24 12:16                   ` Dmitry A. Kazakov
2016-03-24  3:36             ` Shark8
2016-03-24  7:58               ` Dmitry A. Kazakov
2016-03-24 11:42                 ` Dennis Lee Bieber
2016-03-24  1:19 ` rieachus
replies disabled

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