# HG changeset patch # User Richard M. Stallman # Date 903066430 0 # Node ID a8c03459429219206f5ef0de8119255a981511ed # Parent 4dad612df002c3150d4b094fde5d8cdc8edd44b8 (stat): Fall-back to default behaviour when we cannot get accurate information on file attributes. diff -r 4dad612df002 -r a8c034594292 src/w32.c --- 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))