Date: Thu, 12 Sep 1996 09:05:47 +0200 (IST) From: Eli Zaretskii To: DJ Delorie Cc: djgpp-workers AT delorie DOT com Subject: Re: stat("/..") In-Reply-To: <199609120249.WAA19100@delorie.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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).