delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/09/12/02:10:25

Date: Thu, 12 Sep 1996 09:05:47 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: DJ Delorie <dj AT delorie DOT com>
Cc: djgpp-workers AT delorie DOT com
Subject: Re: stat("/..")
In-Reply-To: <199609120249.WAA19100@delorie.com>
Message-Id: <Pine.SUN.3.91.960912085001.15096H-100000@is>
Mime-Version: 1.0

On Wed, 11 Sep 1996, DJ Delorie wrote:

> stat("/..") fails.  Can we special-case this to actually do stat("/")?

We can do anything that pleases us, but IMHO the above is just a tip of an
iceberg (e.g., how about `access'?).  If we trick an app to think there
are fake directory entries, we should go all the way with this lie, or
else `mkisofs' will be happy, but some other program will break. 

Therefore, I suggest we push that lie down to the findfirst/findnext
level, and maybe also duplicate it in `_dos_findfirst' and `_dos_findnext'
(btw, it always bothered me that the `_dos_XXX' functions don't just call
their `traditional' brethren).  For starters, it will fix `stat("/.."),
but it also will fix any other application that might believe "/.."
actually exists and try to do something with it. 

> Note that stat("/") already returns st_nlink as if /. and /.. exist!

That's because the *only* use I saw for that field was to subtract 2 from 
it and then treat the result as the number of subdirectories.  But this 
is also a kludge, albeit a smaller one (at least for DOS programs which 
don't expect to find anything useful in st_nlink).

- Raw text -


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