[Top][All Lists]

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

Re: init_buffer PWD fix

From: Paul Eggert
Subject: Re: init_buffer PWD fix
Date: Mon, 22 Apr 2002 00:22:05 -0700 (PDT)

> Date: Mon, 22 Apr 2002 11:10:55 +0300 (IDT)
> From: Eli Zaretskii <address@hidden>
> > any workaround should apply only to Windows
> > platforms where 'stat' is broken.  Fcopy_file uses the conditional
> > `#if !defined (DOS_NT) || __DJGPP__ > 1' before inspecting st_ino;
> > would that be appropriate here too?
> DJGPP emulates the inodes well enough for the code to work, but the 
> Windows port is not compiled with DJGPP.

Hmm, I guess nobody told the author of Fcopy_file....  Perhaps there's
an opportunity for code consolidation/cleanup there.

Anyway, rather than get sucked into st_ino portability hell, how about
checking st_mtime as well?  That is, after doing this:

      && stat (pwd, &pwdstat) == 0
      && stat (".", &dotstat) == 0
      && dotstat.st_ino == pwdstat.st_ino
      && dotstat.st_dev == pwdstat.st_dev

init_buffer can do this:

      && dotstat.st_mtime == pwdstat.st_mtime

This won't hurt much on non-broken systems, and it should fix the vast
majority of the problem on systems where st_ino is broken.

> Personally, I think the code in buffer.c could compare normalized file 
> names as either an alternative or a complementary to the inode method.

What's a "normalized file name"?  Can it be computed as quickly as an
inode number can?

reply via email to

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