delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/03/17/08:44:10

Date: Sun, 17 Mar 1996 15:39:53 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Mat Hostetter <mat AT ardi DOT com>
Cc: djgpp-workers AT delorie DOT com
Subject: Re: `stat' fails to detect nonexistent files under WinNT
In-Reply-To: <m0tx1eF-000GOKC@gwar.ardi.com>
Message-Id: <Pine.SUN.3.91.960317153025.16543D-100000@is>
Mime-Version: 1.0

On Wed, 13 Mar 1996, Mat Hostetter wrote:

> We have discovered that doing a `stat' of a nonexistent file always
> returns 0 under WinNT (in full screen mode), when it should of course
> return -1.  This is taking place on a normal FAT volume.

What does `stat' return in the `struct stat'?  Does it think this is a
file? a directory? a volume label?  If it's a directory, does it seem like
`stat' decides it's a root directory (the inode number is 1 for root
directories)?  Which bits did `stat' set in the `_djstat_fail_bits'
variable?

To test the above, you might take stat.c from the library sources and
compile it with -DTEST.  It will produce an executable test program which
you should invoke thusly: 

	stat 0 file ...

(0 is the value of the bit-mapped variable `_djstat_flags' that controls
the behavior of `stat'; it is documented in the library on-line docs). 
The program will then stat each of the files from the command line and
print (most of) the contents of `struct stat', together with a
human-readable description of the bits set in `_djstat_fail_bits'.  Please
post the info so that I could isolate the problem (I don't have access to
a WinNT machine). 

- Raw text -


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