Fixes for tasks w full paths
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 10 Jun 2003 12:08:17 +0000 (12:08 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 10 Jun 2003 12:08:17 +0000 (12:08 +0000)
robot.tcl

index 968e64e..c79b410 100755 (executable)
--- 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
             }