emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/w32.c


From: Jason Rumney
Subject: [Emacs-diffs] Changes to emacs/src/w32.c
Date: Sun, 28 Apr 2002 14:52:28 -0400

Index: emacs/src/w32.c
diff -c emacs/src/w32.c:1.72 emacs/src/w32.c:1.73
*** emacs/src/w32.c:1.72        Mon Apr  8 12:45:20 2002
--- emacs/src/w32.c     Sun Apr 28 14:52:26 2002
***************
*** 2153,2168 ****
        }
      }
  
!   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 */
!     }
!   else if (!NILP (Vw32_get_true_file_attributes)
!          /* No access rights required to get info.  */
!          && (fh = CreateFile (name, 0, 0, NULL, OPEN_EXISTING, 0, NULL))
!             != INVALID_HANDLE_VALUE)
      {
        /* This is more accurate in terms of gettting the correct number
         of links, but is quite slow (it is noticable when Emacs is
--- 2153,2163 ----
        }
      }
  
!   if (!NILP (Vw32_get_true_file_attributes)
!       /* No access rights required to get info.  */
!       && (fh = CreateFile (name, 0, 0, NULL, OPEN_EXISTING,
!                          FILE_FLAG_BACKUP_SEMANTICS, NULL))
!          != INVALID_HANDLE_VALUE)
      {
        /* This is more accurate in terms of gettting the correct number
         of links, but is quite slow (it is noticable when Emacs is
***************
*** 2185,2209 ****
          fake_inode = 0;
        }
  
!       switch (GetFileType (fh))
        {
!       case FILE_TYPE_DISK:
!         buf->st_mode = _S_IFREG;
!         break;
!       case FILE_TYPE_PIPE:
!         buf->st_mode = _S_IFIFO;
!         break;
!       case FILE_TYPE_CHAR:
!       case FILE_TYPE_UNKNOWN:
!       default:
!         buf->st_mode = _S_IFCHR;
        }
        CloseHandle (fh);
      }
    else
      {
        /* Don't bother to make this information more accurate.  */
!       buf->st_mode = _S_IFREG;
        buf->st_nlink = 1;
        fake_inode = 0;
      }
--- 2180,2212 ----
          fake_inode = 0;
        }
  
!       if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
!       {
!         buf->st_mode = _S_IFDIR;
!       }
!       else
        {
!         switch (GetFileType (fh))
!           {
!           case FILE_TYPE_DISK:
!             buf->st_mode = _S_IFREG;
!             break;
!           case FILE_TYPE_PIPE:
!             buf->st_mode = _S_IFIFO;
!             break;
!           case FILE_TYPE_CHAR:
!           case FILE_TYPE_UNKNOWN:
!           default:
!             buf->st_mode = _S_IFCHR;
!           }
        }
        CloseHandle (fh);
      }
    else
      {
        /* Don't bother to make this information more accurate.  */
!       buf->st_mode = (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ?
!       _S_IFREG : _S_IFDIR;
        buf->st_nlink = 1;
        fake_inode = 0;
      }
***************
*** 2296,2316 ****
      }
  
    if (info.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 */
!     }
!   else
!     {
!       buf->st_nlink = info.nNumberOfLinks;
!       /* Might as well use file index to fake inode values, but this
!        is not guaranteed to be unique unless we keep a handle open
!        all the time (even then there are situations where it is
!        not unique).  Reputedly, there are at most 48 bits of info
!       (on NTFS, presumably less on FAT). */
!       fake_inode = info.nFileIndexLow ^ info.nFileIndexHigh;
!     }
  
    /* MSVC defines _ino_t to be short; other libc's might not.  */
    if (sizeof (buf->st_ino) == 2)
--- 2299,2313 ----
      }
  
    if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
        buf->st_mode = _S_IFDIR;
! 
!   buf->st_nlink = info.nNumberOfLinks;
!   /* Might as well use file index to fake inode values, but this
!      is not guaranteed to be unique unless we keep a handle open
!      all the time (even then there are situations where it is
!      not unique).  Reputedly, there are at most 48 bits of info
!      (on NTFS, presumably less on FAT). */
!   fake_inode = info.nFileIndexLow ^ info.nFileIndexHigh;
  
    /* MSVC defines _ino_t to be short; other libc's might not.  */
    if (sizeof (buf->st_ino) == 2)



reply via email to

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