summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tltcl/tltcl.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tltcl/tltcl.tcl')
-rw-r--r--Master/tlpkg/tltcl/tltcl.tcl18
1 files changed, 11 insertions, 7 deletions
diff --git a/Master/tlpkg/tltcl/tltcl.tcl b/Master/tlpkg/tltcl/tltcl.tcl
index 11f237b18ce..fdb9deef729 100644
--- a/Master/tlpkg/tltcl/tltcl.tcl
+++ b/Master/tlpkg/tltcl/tltcl.tcl
@@ -548,17 +548,21 @@ proc native_slashify {s} {
proc dir_writable {d} {
for {set x 0} {$x<100} {incr x} {
set y [expr {int(10000*rand())}]
- set newfile [file join $::instroot $y]
+ set newfile [file join $d $y]
if [file exists $newfile] {
continue
} else {
- set fid [open $newfile w]
- chan close $fid
- if [file exists $newfile] {
- file delete $newfile
- return 1
- } else {
+ if [catch {open $newfile w} fid] {
return 0
+ } else {
+ chan puts $fid "hello"
+ chan close $fid
+ if [file exists $newfile] {
+ file delete $newfile
+ return 1
+ } else {
+ return 0
+ }
}
}
}