All pastes #337151 Raw Edit

Stuff

public text v1 · immutable
·published 2007-02-02 15:44 UTC
rendered paste body
proc 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