comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Ada.Directories
Date: Mon, 22 Oct 2007 11:56:00 -0700
Date: 2007-10-22T11:56:00-07:00	[thread overview]
Message-ID: <1193079360.996577.115220@e34g2000pro.googlegroups.com> (raw)
In-Reply-To: <qa32dfmc7uk9$.cb3cqu018xtz$.dlg@40tude.net>

On Oct 20, 2:21 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> Hi all,
>
> I have noticed that GNAT implementation of Ada.Directories.Search "finds"
> the directory being searched and its immediate ancestor in itself (under
> the names "." and ".."). Is it a bug or "feature"? If latter, then I would
> expect at least a special File_Kind value reserved for the mess.

This isn't an easy question.  However, I'd say that it's probably
right to treat "." and ".." as nothing special (at least on Unix-type
system), since that's what I think users expect; they expect to be
able to use "." and ".." as if they were ordinary subdirectory names.
I could be wrong about that.

The flip side is that A.16(45) defines a "directory" as a "container
for files on the target system", and it seems odd to have a directory
containing itself, or its ancestor.  I still think of directory
structures as tree structures, but allowing a directory to contain
itself or its parent makes the structure seem a bit more like a Klein
bottle than a tree.  But since directories on Unix already can contain
references to other directories in other parts of the tree (e.g. hard
links and symbolic links), the structure already isn't a really tree
structure, so I don't see a particular problem with allowing a
directory to contain references to itself and to its parent.  The
"directory" definition has to be somewhat loose anyway, since this
package has to be usable on multiple operating systems.

Maybe the GNAT folks can add a subpackage of Ada.Directories that
contains a routine to control whether "." and ".." are seen as part of
a "directory" file or are treated as invisible.  It seems to me that
it might be appreciated by other users besides Dmitry.  If I used the
Ada.Directories.Search function, I'd probably appreciate the ability
to control this.

                        -- Adam





  parent reply	other threads:[~2007-10-22 18:56 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-20  9:21 Ada.Directories Dmitry A. Kazakov
2007-10-20 18:43 ` Ada.Directories anon
2007-10-20 19:40   ` Ada.Directories Dmitry A. Kazakov
2007-10-20 20:35     ` Ada.Directories Maciej Sobczak
2007-10-21  7:40       ` Ada.Directories Dmitry A. Kazakov
2007-10-21 13:05         ` Ada.Directories Jacob Sparre Andersen
2007-10-21 13:26           ` Ada.Directories Dmitry A. Kazakov
2007-10-21 15:29             ` Ada.Directories Markus E L
2007-10-21 15:38             ` Ada.Directories Jacob Sparre Andersen
2007-10-21 17:19             ` Ada.Directories Martin Krischik
2007-10-21 18:52               ` Ada.Directories Dmitry A. Kazakov
2007-10-21 20:32                 ` Ada.Directories Markus E L
2007-10-21 23:52         ` Ada.Directories Robert A Duff
2007-10-22 11:08         ` Ada.Directories Harald Korneliussen
2007-11-15 11:44           ` Ada.Directories Markus E L
2007-11-16 13:27             ` Ada.Directories Dmitry A. Kazakov
2007-11-16 16:48               ` Ada.Directories Martin Krischik
2007-11-16 18:47                 ` Ada.Directories Larry Kilgallen
2007-11-16 20:35                   ` Ada.Directories Martin Krischik
2007-11-16 19:00                 ` Ada.Directories Dmitry A. Kazakov
2007-10-21  1:25     ` Ada.Directories anon
2007-10-20 22:36   ` Ada.Directories Larry Kilgallen
2007-10-22 18:56 ` Adam Beneschan [this message]
2007-10-23  9:04   ` Ada.Directories Peter Hermann
2007-10-23 12:07     ` Ada.Directories Larry Kilgallen
2007-10-23 13:01       ` Ada.Directories Peter Hermann
2007-10-23 16:08       ` Ada.Directories Robert A Duff
2007-10-23 17:11         ` Ada.Directories Larry Kilgallen
2007-10-24  0:55   ` Ada.Directories Brian May
replies disabled

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