comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: Ada.Directories
Date: Sun, 21 Oct 2007 01:25:57 GMT
Date: 2007-10-21T01:25:57+00:00	[thread overview]
Message-ID: <FUxSi.247338$ax1.150203@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: 1o4hp0vtlenw0.jql7yewhhr4a.dlg@40tude.net


The "." and ".." are not aliases they are actual directory entries in each 
directory, except for FAT partitions. 

Note: Any directory can have sub-directories with the same name that 
exist in other directories or sub-directories. Just that in this case the 
"." and ".." each have specific value set by the file system drivers 
under the operating system.

Like:

  / (root) => 
      .  -- point to / aka root
      .. -- point to / aka root ( special case )

      sub-dir_0 => 
          .  -- point to /sub-dir_0
          .. -- point to / aka root

          sub-dir_2 => 
              .  -- point to /sub-dir_0/sub-dir_2
              .. -- point to /sub-dir_0

    ...

Now in using the Directory_Search ( "/Sub_Dir_0/Sub_Dir_2_0/*" ) 

First entry would be a record that contain the Entry_ID "." and 
a allocation_link of "/Sub_Dir_0/Sub_Dir_2_0

Second entry would be a record that contain the Entry_ID ".." and 
a allocation_link will be "/Sub_Dir_0

The file system designer and OS designer even though you do not like 
it, created a standard that uses "." to mean current directory and ".." 
to represent the current directory parent directory. This has nothing to 
do with GNAT or Ada. The file system standards have been adopted 
by the "Ada Standards" for Ada 2005. In general, that means that 
Ada.Directory and its sub packages link to the OS user routines and 
insert the data into a Directory Record that is in the "Ada Standards".  
Which means you are dealing with specfic details of the OS file system 
that can be use in any language.

Also, there is no direct way to render the "." or ".." to its name true 
name, in any language.  You must build a routine that first compares 
the allocation of "." and "..", if equal then current directory is root. 
Else the routine searches the parent directory ("..") for the same 
allocation as the current directory (".").  Once found then the name_id 
is the current directory name. 


In <1o4hp0vtlenw0.jql7yewhhr4a.dlg@40tude.net>, "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>On Sat, 20 Oct 2007 18:43:21 GMT, anon wrote:
>
>> Its a "File System" feature!
>> 
>> In today's file systems, the first two entries are "." and ".." directories.  
>> One exception to this rule is the FAT file systems which does not contain 
>> these two entries.
>
>Neither the root directory of a volume does. But that is irrelevant to the
>issue.
>
>> So if you seach the entire directory, the first two names that will be 
>> returned are "." and ".." unless you search a FAT partition or a floopy.
>> 
>> All languages including Ada, C, JAVA that have directory search routine 
>> will act in same way.
>
>I don't care how an OS-specific search might work. That is actually the
>reason why I use Ada.Directories, which abstracts any concrete OS. So the
>question is whether appearance of ".." is a requirement. Maybe, ".." is an
>alias name? But then
>
>1. Why there is no File_Kind value for aliases?
>
>2. Why Full_Name of the Directory_Entry corresponding to ".." does not
>render the true name of? Can the same file have different full names?
>
>-- 
>Regards,
>Dmitry A. Kazakov
>http://www.dmitry-kazakov.de




  parent reply	other threads:[~2007-10-21  1:25 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     ` anon [this message]
2007-10-20 22:36   ` Ada.Directories Larry Kilgallen
2007-10-22 18:56 ` Ada.Directories Adam Beneschan
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