Stuff
public text v1 · immutableproc readlog {fp} {
if {[gets $fp line] < 0} {
#if {[eof $fp]} {
# close $fp
# return
#}
#exit
} else {
putlog $line
}
}
proc initlog {} {
if {[catch {open test.txt} fp] != 0} {
putlog "error"
return
}
#fconfigure $fp -blocking 0
fileevent $fp readable [list readlog $fp]
# while {1} {
# vwait test
# }
# close $fp
}
initlog