summaryrefslogtreecommitdiffstats
path: root/win/tclWinFile.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-19 13:37:40 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-19 13:37:40 (GMT)
commitf02a6bd750b0c1da6b070dc9faf45562fa1c560d (patch)
tree646f2a6b59fcbb0ab7e2d0501c4be7010f376ff8 /win/tclWinFile.c
parent5a70331359bc92b4db9825df010a92b9d6fe5b3f (diff)
downloadtcl-f02a6bd750b0c1da6b070dc9faf45562fa1c560d.zip
tcl-f02a6bd750b0c1da6b070dc9faf45562fa1c560d.tar.gz
tcl-f02a6bd750b0c1da6b070dc9faf45562fa1c560d.tar.bz2
make sure that [file stat] returns the right data, even for locked files.
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r--win/tclWinFile.c6
1 files changed, 6 insertions, 0 deletions
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);
}