From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Keiichiro Nagano (=?ISO-2022-JP?B?GyRCMUpMbjc9MGxPOhsoQg==?=) Newsgroups: gmane.emacs.devel Subject: Re: init_buffer PWD fix Date: Mon, 22 Apr 2002 16:20:48 +0900 Organization: Team Sodan (http://sodan.org/) Sender: emacs-devel-admin@gnu.org Message-ID: References: <200204220618.g3M6Icg23696@sic.twinsun.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Mon_Apr_22_16:20:48_2002-1" X-Trace: main.gmane.org 1019460152 22780 127.0.0.1 (22 Apr 2002 07:22:32 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 22 Apr 2002 07:22:32 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16zY9g-0005vJ-00 for ; Mon, 22 Apr 2002 09:22:32 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16zYAG-0005Y9-00 for ; Mon, 22 Apr 2002 09:23:09 +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 16zY9V-000255-00; Mon, 22 Apr 2002 03:22:21 -0400 Original-Received: from fw1280219.kitanet.ne.jp ([210.237.128.219] helo=omni-engine.com) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 16zY82-0001yP-00 for ; Mon, 22 Apr 2002 03:20:50 -0400 Original-Received: from bed.omni-engine.com (localhost [127.0.0.1]) by omni-engine.com (Postfix) with ESMTP id 82A9CE54D0; Mon, 22 Apr 2002 16:20:48 +0900 (JST) Original-To: Paul Eggert In-Reply-To: <200204220618.g3M6Icg23696@sic.twinsun.com> User-Agent: Wanderlust/2.9.9 (Unchained Melody) EMY/1.13.9 (Art is long, life is short) LIMIT/1.14.7 (Fujiidera) APEL/10.3 Emacs/21.2.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) 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:2986 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2986 --Multipart_Mon_Apr_22_16:20:48_2002-1 Content-Type: text/plain; charset=US-ASCII At Sun, 21 Apr 2002 23:18:38 -0700 (PDT), Paul Eggert wrote: > > init_buffer uses environmental variable PWD to identify current > > working directory. I think we should not use it on Windows. On > > Windows with Cygwin, PWD is unreliable and confusing > > PWD is unreliable on all platforms, but Emacs works around the problem > with a similar method on all platforms by statting $PWD and ".", and > using $PWD only if stat results agree. What is the problem with > this workaround on Windows? You cannot get st_ino which makes sence (without cygwin1.dll). Compile stattest.c on Windows by MSVC (cl.exe), and you will see: ---- $ ./stattest stattest.c: 0 stattest.exe: 0 .: 0 ..: 0 C:\: 0 C:\WINNT: 0 nonexist: stat failed ---- I wrote, compiled and run this code on Windows 2000 SP2 SRP1 with NTFS partition. -- Keiichiro Nagano --Multipart_Mon_Apr_22_16:20:48_2002-1 Content-Type: text/plain; charset=US-ASCII Content-Disposition: attachment; filename="stattest.c" /* compile: cl stattest.c */ #include #include void print_ino (char *target) { struct stat statbuf; if (stat (target, &statbuf) == 0) printf ("%s: %d\n", target, statbuf.st_ino); else printf ("%s: stat failed\n", target); } int main (void) { print_ino ("stattest.c"); print_ino ("stattest.exe"); print_ino ("."); print_ino (".."); print_ino ("C:\\"); print_ino ("C:\\WINNT"); print_ino ("nonexist"); return 0; } --Multipart_Mon_Apr_22_16:20:48_2002-1--