delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/02/16/19:26:44

Sender: RUPP AT gnat DOT com
Message-ID: <330734E7.4313C7C3@gnat.com>
Date: Sun, 16 Feb 1997 16:25:11 +0000
From: Douglas Rupp <rupp AT gnat DOT com>
Organization: Ada Core Technologies
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: djgpp-workers AT delorie DOT com, Charles Sandmann <sandmann AT clio DOT rice DOT edu>
Subject: Re: fstat returns garbage
References: <Pine DOT SUN DOT 3 DOT 91 DOT 970216094004 DOT 14977J-100000 AT is>

Eli Zaretskii wrote:
> You will have to debug this a bit more, sorry.  I can understand weird
> things happening with st_mode, since `fstat' does some trickery to get at
> the attribute bits, but zero st_size?  That just seems impossible, since
> `fstat' simply calls `filelength' (which is just a call to DOS seek
> functions in disguise) to get the file size, so I fail to see how that
> could fail.  Can you step into `fstat' code, or put some debugging
> printf's there, and see what exactly happens in these cases?  Thanks.
> 

Filelength is returning the right size, but since the "is device" flag
bit is set, it never makes it into the st_size field.  Just putting the
size into the st_size field won't fix it though, because my code checks
to see if it's a regular file before returning the size.

I'm guessing that the field from which fstat determines if the handle is
a device or not has been changed on NT.

- Raw text -


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