changeset 23016:a8c034594292

(stat): Fall-back to default behaviour when we cannot get accurate information on file attributes.
author Richard M. Stallman <rms@gnu.org>
date Fri, 14 Aug 1998 03:47:10 +0000
parents 4dad612df002
children 3261e4a5f472
files src/w32.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32.c	Fri Aug 14 01:15:33 1998 +0000
+++ b/src/w32.c	Fri Aug 14 03:47:10 1998 +0000
@@ -1948,16 +1948,16 @@
       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))
+  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
 	 making a list of file name completions). */
       BY_HANDLE_FILE_INFORMATION info;
 
-      /* No access rights required to get info.  */
-      fh = CreateFile (name, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
-
       if (GetFileInformationByHandle (fh, &info))
 	{
 	  switch (GetFileType (fh))