diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-03-19 13:37:40 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-03-19 13:37:40 (GMT) |
commit | e22aa5854dc50ba15a3966093bec99d37059b93e (patch) | |
tree | 646f2a6b59fcbb0ab7e2d0501c4be7010f376ff8 /win | |
parent | 91e20aef42924f070b2b9f28aae041abcc7a0966 (diff) | |
download | tcl-e22aa5854dc50ba15a3966093bec99d37059b93e.zip tcl-e22aa5854dc50ba15a3966093bec99d37059b93e.tar.gz tcl-e22aa5854dc50ba15a3966093bec99d37059b93e.tar.bz2 |
make sure that [file stat] returns the right data, even for locked files.
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinFile.c | 6 |
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); } |