Hi!
My question is simple: how can I wait the execution of the rest of my tcl program until the exec has finished. In the example below the file that is being created is read straight away although the exec has not finished.
set cmd [list lincat $swprjsel > /tmp/lincat]
set execCmd "exec $cmd"
catch { eval $execCmd } result
puts $result
# open the file
if { ![file exists "/tmp/lincat"] } {
# cannot find or open the file
tk_messageBox -title "Error: lincat" -message "Cannot run Lincat on this project\nExiting.." -type ok
exit
} else {
set fd [ open "/tmp/lincat" "r"]
puts "Reading plist..\n"
while {[gets $fd l] != -1} {
puts "[lindex $l 0]"
lappend linelist [lindex $l 0]
}
close $fd
puts $linelist
}
Thanks,
My question is simple: how can I wait the execution of the rest of my tcl program until the exec has finished. In the example below the file that is being created is read straight away although the exec has not finished.
set cmd [list lincat $swprjsel > /tmp/lincat]
set execCmd "exec $cmd"
catch { eval $execCmd } result
puts $result
# open the file
if { ![file exists "/tmp/lincat"] } {
# cannot find or open the file
tk_messageBox -title "Error: lincat" -message "Cannot run Lincat on this project\nExiting.." -type ok
exit
} else {
set fd [ open "/tmp/lincat" "r"]
puts "Reading plist..\n"
while {[gets $fd l] != -1} {
puts "[lindex $l 0]"
lappend linelist [lindex $l 0]
}
close $fd
puts $linelist
}
Thanks,