Posted to tcl by schelte at Sat May 28 20:30:18 GMT 2011view raw
- set file testfile.avi
- set f [open "| avisplit -i $file -o base -s 5 2>@1"]
- fconfigure $f -blocking 0
- fileevent $f readable [list WaitForExit $f]
- proc WaitForExit {fd} {
- if {[catch {gets $fd line} fail]} {
- return -code error $fail
- } elseif {[eof $fd]} {
- if {[catch {close $fd} fail]} {
- return -code error $fail
- } else {
- set ::forever Done
- return 0
- }
- } {
- return 1
- }
- }
- vwait forever