|
2013-03-19
| ||
| 21:26 | • Closed ticket [2893771fff]: file stat fails on locked files on win32 plus 7 ... artifact: 610d4f2a73 user: nijtmans | |
| 19:03 | • Ticket [2893771fff]: 4 changes artifact: 51e1f732cf user: nijtmans | |
| 18:50 | • Open ticket [2893771fff]. artifact: 1511bc5682 user: nijtmans | |
|
2009-11-24
| ||
| 07:08 | • Closed ticket [2893771fff]. artifact: 2a233ddb34 user: patthoyts | |
|
2009-11-07
| ||
| 17:21 | • Ticket [2893771fff]: 4 changes artifact: 65551b2b37 user: patthoyts | |
| 17:21 | • Add attachment file-stat.patch to ticket [2893771fff] artifact: 87c37bb659 user: patthoyts | |
| 10:21 | • New ticket [2893771fff] file stat fails on locked files on win32. artifact: 6f926fb4f9 user: patthoyts | |
file stat fails on locked files on win32
Closed / Fixed2893771fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 14 years ago
Descriptionplain2009-11-07 10:21:21
On Windows the page file c:\pagefile.sys is always open and locked. In NativeAccess we try using GetFileAttributes but this will return ERROR_SHARING_VIOLATION and -1, leading Tcl to believe the file does not exist. Similar code is in NativeStat fails for the same reason. So we cannot currently test for the existence or size or mtime for this file. However if we then try FindFirstFile for the pathname we can get this information even though the file is in use. The attached patch tries FindFirstFile when GetFIleAttributes fails. GFA is a bit faster on my system than FFF so I prefer to only try this when necessary. I've not checked for the GetLastError() code as well as I don't know if other error codes might still be appropriate for continuing to check using FFF.
patthoytsplain2009-11-07 17:21:23
File Added - 349887: file-stat.patch
patthoytsplain2009-11-24 07:08:50
allow_comments - 1 I have applied this patch with a new test to the HEAD 8.6 code.
nijtmansplain2013-03-19 18:50:19
allow_comments - 0 Had to back out this patch, because of bug [3608360]: Incompatible behaviour of "file exists".
nijtmansplain2013-03-19 19:03:40
I would prefer another solution for this problem. If GetFileAttributes() returns ERROR_SHARING_VIOLATION, then we know that the file exists but is not readable and not writable. Let's thread that as a special case.
nijtmansplain2013-03-19 21:26:34
allow_comments - 1 Fixed now on all branches.
Log in (anonymous is fine) to add a comment.
Attachments:
- file-stat.patch [download] added by patthoyts on 2009-11-07 17:21:23. [details]