[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: init_buffer PWD fix

From: 宮下 尚:HIMI
Subject: Re: init_buffer PWD fix
Date: Wed, 24 Apr 2002 15:52:06 +0900
User-agent: T-gnus/6.15.4 (based on Oort Gnus v0.04) (revision 11) SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/21.1 (i386-msvc-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/1.99 Alpha1 (AWOFUCHI)

Paul Eggert <address@hidden> writes:

> Efficiency is not the primary concern here.  More important are:


> Your benchmark indicates that Emacs needs to spend one microsecond to
> get the nicer name on your host; that's a win in my book.

O.K.  In short, this code is not mainly for optimization, but rather in
order to receive more appropriate pathname from the shell (or any other
invoking program).  I agree on it.

So we should change the comment not to misunderstand the intention.  Thanks.

BTW, on Windows, the current code dose not works correctly because of stat() 
In the current implemenation, stat() always return the same value as inode.  
see the following, which is cut from stat()@w32.c.

  if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
      buf->st_mode = _S_IFDIR;
      buf->st_nlink = 2;        /* doesn't really matter */
      fake_inode = 0;           /* this doesn't either I think */

I think we have three choices to solve it.

(1) Generate a proper inode value as well as for the directory
(2) At the startup, set "PWD" env. to the value of getcwd().
(3) Use always getcwd() when WINDOWSNT(or DOS_NT?) is defined.

As for (1), generate fake_inode from the value of FileIndex obtained
by GetFileInformationByHandle().
But on WINDOWSNT, I'd like to apply (3) change too because on W32
we don't have to (or should not) take such rather profound intentions
into considerations.

  With regards,

from himi

reply via email to

[Prev in Thread] Current Thread [Next in Thread]