Sender: RUPP AT gnat DOT com Message-ID: <330734E7.4313C7C3@gnat.com> Date: Sun, 16 Feb 1997 16:25:11 +0000 From: Douglas Rupp Organization: Ada Core Technologies MIME-Version: 1.0 To: Eli Zaretskii CC: djgpp-workers AT delorie DOT com, Charles Sandmann Subject: Re: fstat returns garbage References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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.