From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,96296bb60aa5db9 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!e34g2000pro.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Ada.Directories Date: Mon, 22 Oct 2007 11:56:00 -0700 Organization: http://groups.google.com Message-ID: <1193079360.996577.115220@e34g2000pro.googlegroups.com> References: NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1193079370 31774 127.0.0.1 (22 Oct 2007 18:56:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 22 Oct 2007 18:56:10 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: e34g2000pro.googlegroups.com; posting-host=66.126.103.122; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:2548 Date: 2007-10-22T11:56:00-07:00 List-Id: On Oct 20, 2:21 am, "Dmitry A. Kazakov" 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