xfs
[Top] [All Lists]

RE: ".", "..", and cd

To: <stimits@xxxxxxxxxx>, <linux-xfs@xxxxxxxxxxx>
Subject: RE: ".", "..", and cd
From: "Adam H. Pendleton" <fmonkey@xxxxxxxxxxx>
Date: Sat, 8 Sep 2001 02:13:08 -0400
Importance: Normal
In-reply-to: <3B99B55E.CF8F4F16@xxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
I don't have the "correct" answer to this question, but I am using a box
with reiserfs as its root partition (shh, it's my dirty little secret --
don't tell anyone), and a "cd .." on the root partition gives me no
error.

Adam H. Pendleton

-----Original Message-----
From: owner-linux-xfs@xxxxxxxxxxx [mailto:owner-linux-xfs@xxxxxxxxxxx]
On Behalf Of D. Stimits
Sent: Saturday, September 08, 2001 02:06
To: XFS: linux-xfs@xxxxxxxxxxx
Subject: ".", "..", and cd

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.

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.

D. Stimits, stimits@xxxxxxxxxx



<Prev in Thread] Current Thread [Next in Thread>