Tcl Source Code

Check-in [7eee715c3f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Handle the (unlikely) case that the file is deleted in between. Suggested by Harald Oehlmann (Thanks!)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7eee715c3fbc09204d2990724bcdb78fef8c8809
User & Date: jan.nijtmans 2013-03-19 14:59:26
Context
2013-03-20
13:41
Slightly more correct: If FindFirstFile() fails, the error should be "no such file or directory" (EN... check-in: d2de88281c user: jan.nijtmans tags: trunk
2013-03-19
14:59
Handle the (unlikely) case that the file is deleted in between. Suggested by Harald Oehlmann (Thanks... check-in: 7eee715c3f user: jan.nijtmans tags: trunk
14:57
Handle the (unlikely) case that the file is deleted in between. Suggested by Harald Oehlmann (Thanks... check-in: 2314a4bd26 user: jan.nijtmans tags: core-8-5-branch
14:39
3597000 Consistent [file copy] result. check-in: 64f4ffa382 user: dgp tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to win/tclWinFile.c.

2002
2003
2004
2005
2006
2007
2008




2009
2010
2011
2012
2013
2014
2015
	    DWORD lasterror = GetLastError();

	    if (lasterror != ERROR_SHARING_VIOLATION) {
		TclWinConvertError(lasterror);
		return -1;
		}
	    hFind = FindFirstFile(nativePath, &ffd);




	    memcpy(&data, &ffd, sizeof(data));
	    FindClose(hFind);
	}

	attr = data.dwFileAttributes;

	statPtr->st_size = ((Tcl_WideInt) data.nFileSizeLow) |







>
>
>
>







2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
	    DWORD lasterror = GetLastError();

	    if (lasterror != ERROR_SHARING_VIOLATION) {
		TclWinConvertError(lasterror);
		return -1;
		}
	    hFind = FindFirstFile(nativePath, &ffd);
	    if (hFind == INVALID_HANDLE_VALUE) {
		TclWinConvertError(lasterror);
		return -1;
	    }
	    memcpy(&data, &ffd, sizeof(data));
	    FindClose(hFind);
	}

	attr = data.dwFileAttributes;

	statPtr->st_size = ((Tcl_WideInt) data.nFileSizeLow) |