Date: Sun, 19 Oct 1997 17:16:44 +0200 (IST) From: Eli Zaretskii To: mark AT bigdog DOT fred DOT net cc: djgpp AT delorie DOT com Subject: Re: stat() system call return value problem In-Reply-To: <62503b$p53@bigdog.fred.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On 16 Oct 1997 mark AT bigdog DOT fred DOT net wrote: > main() > { > struct stat s; > > printf("%d\n",stat("test",&s)); > } > > Now if I run this on the linux box the return values for stat > are correct (0 if it's there, -1 if not). But compiling with > dos_gcc and running on a win95 machine it always returns a 0. I cannot reproduce this. On my machine, also with Windows 95, the program prints -1 when the file `test' isn't there, 0 when it is. Please make sure that the file `test' indeed doesn't exist when you think it doesn't (it might be hidden or something). If you cannot find the reason to your behavior, please change your program to print all the members of struct stat that are returned for `test' and post the output.