summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/tltcl/tltcl.tcl
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-04-11 03:09:12 +0000
committerNorbert Preining <norbert@preining.info>2020-04-11 03:09:12 +0000
commitc2697fc286a1e2c94fd9968b76be6f4a6d2114cd (patch)
tree1dc2cfb07cb032740483dd8be7c74aff66b70352 /systems/texlive/tlnet/tlpkg/tltcl/tltcl.tcl
parent25111608e6aa05042b0c6f83009262e1973d7a45 (diff)
CTAN sync 202004110309
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tltcl/tltcl.tcl')
-rw-r--r--systems/texlive/tlnet/tlpkg/tltcl/tltcl.tcl18
1 files changed, 11 insertions, 7 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tltcl/tltcl.tcl b/systems/texlive/tlnet/tlpkg/tltcl/tltcl.tcl
index 11f237b18c..fdb9deef72 100644
--- a/systems/texlive/tlnet/tlpkg/tltcl/tltcl.tcl
+++ b/systems/texlive/tlnet/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
+ }
}
}
}