Mail Archives: djgpp/1998/07/15/09:08:37
On Wed, 15 Jul 1998, Lord Daedron wrote:
> Here is where the problem begins. If the user selects ".." ( previous
> directory, or parent directory ), the directory string would be:
> ".\directory\..". If the user reselects it over and over again, it could be
> humongous: ".\directory\..\directory\..\sirectory\.." on so on. My question
> is if there is a function that will simplify this
Such a function exists, it is called `_fixpath'. Look up its
documentation in the library reference.
> Second, if I start in a sub-directory, and the user selects ".." from the
> starting ( first viewed ) directory, it seems to not read the directory
> right ( shows nothing but ".." as a choice ). Why does opendir () and
> readir () do this?
I would say this looks like a bug in your code. readdir doesn't do
anything special for this case. Please post the shortest program that
can be used to reproduce this problem. Or at least describe what files
are in the ".." directory and what is its full path name.
- Raw text -