make-w32
[Top][All Lists]
Advanced

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

Re: directory caching anomalies in win32


From: Eli Zaretskii
Subject: Re: directory caching anomalies in win32
Date: Tue, 24 Apr 2007 01:07:41 +0300

> Date: Mon, 23 Apr 2007 07:45:03 -0700 (PDT)
> From: Aaron Shatters <address@hidden>
> Cc: address@hidden
> 
> >> Date: Fri, 20 Apr 2007 13:53:31 -0700 (PDT)
> >> From: Aaron Shatters <address@hidden>
> >> 
> >> What was the reason for rehashing the directory contents for windows if 
> >> the file was not found in the directory cache and the directory has been 
> >> modified... but not on any other platforms?
> >
> >Could you please point to the code fragment(s) where you see this
> >difference?
> 
> In dir.c -->
> 
>   if (dir->dirstream == 0)
>   {
> #ifdef WINDOWS32
>     /*
>      * Check to see if directory has changed since last read. FAT
>      * filesystems force a rehash always as mtime does not change
>      * on directories (ugh!).
>      */
>      if (dir->path_key)
>      {
>        if ((dir->fs_flags & FS_FAT) != 0)
>        {
>          dir->mtime = time ((time_t *) 0);
>          rehash = 1;
>        }
>        else if (stat(dir->path_key, &st) == 0 && st.st_mtime > dir->mtime)
>        {
>          /* reset date stamp to show most recent re-process.  */
>          dir->mtime = st.st_mtime;
>          rehash = 1;
>        }
>        /* If it has been already read in, all done.  */
>        if (!rehash)
>          return 0;
>        /* make sure directory can still be opened; if not return.  */
>        dir->dirstream = opendir(dir->path_key);
>        if (!dir->dirstream)
>          return 0;
>      }
>      else
> #endif

This fragment handles the problem that inode emulation on Windows
filesystems are not reliable.  It replaces the inode check by
`stat'ing the directory whose normalized file name is stored in
dir->path_key.

Does this code really get run when you invoke $wildcard, and why?




reply via email to

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