Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exec question

Status
Not open for further replies.

fabien

Technical User
Sep 25, 2001
299
AU
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,

 
Don't worry I've used bgexec instead and it works fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top