From: Adam Dickmeiss Date: Tue, 10 Jun 2003 12:08:17 +0000 (+0000) Subject: Fixes for tasks w full paths X-Git-Tag: tclrobot.0.2.0~18 X-Git-Url: http://git.indexdata.com/?p=tclrobot.git;a=commitdiff_plain;h=af32193102402a540c3b0331c5db03d1d5a66c46 Fixes for tasks w full paths --- diff --git a/robot.tcl b/robot.tcl index 968e64e..c79b410 100755 --- a/robot.tcl +++ b/robot.tcl @@ -1,5 +1,5 @@ #!/usr/bin/tclsh -# $Id: robot.tcl,v 1.36 2003/06/10 11:55:18 adam Exp $ +# $Id: robot.tcl,v 1.37 2003/06/10 12:08:17 adam Exp $ # proc RobotFileNext1 {area lead} { # puts "RobotFileNext1 area=$area lead=$lead" @@ -148,6 +148,8 @@ proc RobotFileOpen {task area host path {mode w}} { global status global debuglevel + puts "RobotFileOpen task=$task path=$path" + if {![info exists workdir]} { return stdout } @@ -169,7 +171,10 @@ proc RobotFileOpen {task area host path {mode w}} { for {set i 0} {$i <= $len} {incr i} { set d [lindex $comp $i] - if {[catch {cd $d}]} { + if {[string length $d] == 0} { + cd / + } elseif {[catch {cd $d}]} { + puts "mkdir (1) d=$d" exec mkdir $d cd ./$d if {![string compare $area unvisited] && $i == $len && $mode == "w"} { @@ -193,6 +198,7 @@ proc RobotFileOpen {task area host path {mode w}} { set d "d[lindex $comp $i]" if {[string length $d] > 1} { if {[catch {cd $d}]} { + puts "mkdir (2) d=$d" exec mkdir $d cd ./$d }