From: Richard M. Stallman Date: Fri, 14 Aug 1998 03:47:10 +0000 (+0000) Subject: (stat): Fall-back to default behaviour when we cannot get X-Git-Tag: emacs-20.3~63 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=710ea1b88df094830200f6082163b231591f0250;p=emacs.git (stat): Fall-back to default behaviour when we cannot get accurate information on file attributes. --- diff --git a/src/w32.c b/src/w32.c index ca4b50ecb2d..68ed2b5dcbb 100644 --- a/src/w32.c +++ b/src/w32.c @@ -1948,16 +1948,16 @@ stat (const char * path, struct stat * buf) 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))