From f02a6bd750b0c1da6b070dc9faf45562fa1c560d Mon Sep 17 00:00:00 2001
From: "jan.nijtmans" <nijtmans@users.sourceforge.net>
Date: Tue, 19 Mar 2013 13:37:40 +0000
Subject: make sure that [file stat] returns the right data, even for locked
 files.

---
 win/tclWinFile.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 8e41096..22fc6f3 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -1892,11 +1892,17 @@ NativeStat(nativePath, statPtr, checkLinks)
 	if((*tclWinProcs->getFileAttributesExProc)(nativePath,
 						   GetFileExInfoStandard,
 						   &data) != TRUE) {
+	    HANDLE hFind;
+	    WIN32_FIND_DATAT ffd;
 	    DWORD lasterror = GetLastError();
+
 	    if (lasterror != ERROR_SHARING_VIOLATION) {
 		TclWinConvertError(lasterror);
 		return -1;
 		}
+	    hFind = (*tclWinProcs->findFirstFileProc)(nativePath, &ffd);
+	    memcpy(&data, &ffd, sizeof(data));
+	    FindClose(hFind);
 	}
 
     
-- 
cgit v0.12