www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/15/09:08:37

Date: Wed, 15 Jul 1998 16:07:52 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Lord Daedron <daedron AT provide DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: File System Commands
In-Reply-To: <35ac35c2.0@news.provide.net>
Message-ID: <Pine.SUN.3.91.980715160240.12215C-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019