sudhan1980
Programmer
Dear all,
I use Tip 86 to trace execution of script and like to print the traced info of everyline through my own procedure call print_lines. Script throws error , when i try to open a file and access the contents.
Note 1: Instead of proc call "print_lines", if i specify standard channel "stdout". script executes smoothly.
Code :
------
proc print_lines { args } {
puts "Argument List : $args"
}
trace execution print_lines
set fd [ open "/tmp/user/hello.txt" "r" ]
while { [ gets $fd readdata ] != -1 } {
puts $readdata
}
close $fd
Error : "can not find channel named print_lines "file5
Thanks for all your solutions in advance....
I use Tip 86 to trace execution of script and like to print the traced info of everyline through my own procedure call print_lines. Script throws error , when i try to open a file and access the contents.
Note 1: Instead of proc call "print_lines", if i specify standard channel "stdout". script executes smoothly.
Code :
------
proc print_lines { args } {
puts "Argument List : $args"
}
trace execution print_lines
set fd [ open "/tmp/user/hello.txt" "r" ]
while { [ gets $fd readdata ] != -1 } {
puts $readdata
}
close $fd
Error : "can not find channel named print_lines "file5
Thanks for all your solutions in advance....