"D. Stimits" wrote:
>
> This is probably not an XFS question per se, but might be, I'm not sure.
> I use XFS on the root system, and am working on some directory and file
> scanning code. One of the banes of this is to scan for files or
> directories beginning with ".", without always viewing the current
> directory and its parent directory, "..". While doing some testing of
> special cases, I discovered that if I look for files in the root
> directory "/" (on XFS), through the "glob" function (which presumably is
> used in code of some shells for its pattern matching), looking for files
> of pattern ".*", then doing so in "/" results in both "/./" (I have the
> flag set to append "/" to the end of directory values) and "/../". This
> latter entry is a curiosity, seeing as the root partition does not have
> a parent. If I cd to "/", and then do "cd ..", there is no error either,
> I just end up where I started.
If You want to omit this, try to match .??* .
> Is this the standard, expected behavior (possibly POSIX or HFS
> designated)? Or would different filesystems behave differently, where
> some complain about "cd .." when already in the root? At this point it
> is really nothing more than a curiosity, but it sticks out during
> testing.
It is the expected behavior.
Regards,
Harald
--
Harald Wagener | Systemadministrator
FCB/Wilkens GmbH | Tel.:+49-40-2881-1252
An der Alster 42 | Fax.:+49-40-2881-1263
20099 Hamburg | http://www.fcb-wilkens.com
|