[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bad result from stat/fstat on W95
From: |
Juanma Barranquero |
Subject: |
Re: Bad result from stat/fstat on W95 |
Date: |
Sat, 25 May 2002 20:47:09 -0300 |
Jason Rumney <address@hidden> writes:
> I don't have access to a W9x system. Please try to debug what is
> going wrong in stat or fstat. I was careful to catch errors returned
> by the system calls, as support on W9x/ME is known to be lacking.
> But perhaps they are returning successfully, but with invalid data.
> Can we easily tell if the file index returned is invalid? (eg is it 0
> in these cases; probably not or the code would work as before I think).
Finally I´ve found the time to debug it and I´ve found that the problem
happens exclusively when trying to write a non-existent file, because
the check to see the "writable status" of the directory on which it
would be written is failing.
I think the problem is the following line in stat() (w32.c ~ line 2209):
buf->st_mode = (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ?
_S_IFREG : _S_IFDIR;
because the condition seems to be reversed. If you agree I´ll commit the
patch to fix it.
Juanma