summaryrefslogtreecommitdiffstats
path: root/tests/fCmd.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-19 13:48:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-19 13:48:37 (GMT)
commit01ae22053af8cd618c105c63909fa6386f316bbc (patch)
treeb98cf0261f632507519e0f2c89046224feb09eac /tests/fCmd.test
parent5c41a9fc8aa1f968ef6bbf23f5713c1341d8d057 (diff)
parentf02a6bd750b0c1da6b070dc9faf45562fa1c560d (diff)
downloadtcl-01ae22053af8cd618c105c63909fa6386f316bbc.zip
tcl-01ae22053af8cd618c105c63909fa6386f316bbc.tar.gz
tcl-01ae22053af8cd618c105c63909fa6386f316bbc.tar.bz2
[Bug 2893771]: file stat fails on locked files on win32.
Diffstat (limited to 'tests/fCmd.test')
-rw-r--r--tests/fCmd.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/fCmd.test b/tests/fCmd.test
index 4e27d22..682d5e4 100644
--- a/tests/fCmd.test
+++ b/tests/fCmd.test
@@ -2539,6 +2539,28 @@ file delete -force d1/d2
file delete -force d1
cd [workingDirectory]
+test fCmd-30.1 {file writable on 'My Documents'} -setup {
+ # Get the localized version of the folder name by looking in the registry.
+ set mydocsname [registry get {HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders} Personal]
+} -constraints {win reg} -body {
+ file writable $mydocsname
+} -result 1
+test fCmd-30.2 {file readable on 'NTUSER.DAT'} -constraints {win} -body {
+ expr {[info exists env(USERPROFILE)]
+ && [file exists $env(USERPROFILE)/NTUSER.DAT]
+ && [file readable $env(USERPROFILE)/NTUSER.DAT]}
+} -result {1}
+test fCmd-30.3 {file readable on 'pagefile.sys'} -constraints {win} -body {
+ set r {}
+ if {[info exists env(SystemDrive)]} {
+ set path $env(SystemDrive)/pagefile.sys
+ lappend r exists [file exists $path]
+ lappend r readable [file readable $path]
+ lappend r stat [catch {file stat $path a} e] $e
+ }
+ return $r
+} -result {exists 1 readable 0 stat 0 {}}
+
removeFile abc2.file
removeFile abc.file
removeDirectory abc2.dir