From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: Bad result from stat/fstat on W95 Date: Sat, 25 May 2002 20:47:09 -0300 Sender: emacs-devel-admin@gnu.org Message-ID: <20020525203857.B531.LEKTU@terra.es> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1022352682 23691 127.0.0.1 (25 May 2002 18:51:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 25 May 2002 18:51:22 +0000 (UTC) Cc: Jason Rumney Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17BgdO-0006A0-00 for ; Sat, 25 May 2002 20:51:22 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17Bgts-000836-00 for ; Sat, 25 May 2002 21:08:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17Bgdd-0001Mg-00; Sat, 25 May 2002 14:51:37 -0400 Original-Received: from mailhost2.teleline.es ([195.235.113.141] helo=tsmtp4.mail.isp) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17Bgbx-0001H0-00; Sat, 25 May 2002 14:49:53 -0400 Original-Received: from cenelia ([213.99.113.105]) by tsmtp4.mail.isp (Netscape Messaging Server 4.15 tsmtp4 Mar 14 2002 21:29:48) with ESMTP id GWOK8Q00.VTG; Sat, 25 May 2002 20:48:26 +0200 Original-To: emacs-devel@gnu.org In-Reply-To: X-Mailer: Becky! ver. 2.00.10 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:4376 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:4376 Jason Rumney 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=B4ve found the time to debug it and I=B4ve 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 =3D (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? _S_IFREG : _S_IFDIR; because the condition seems to be reversed. If you agree I=B4ll commit the patch to fix it. Juanma