Help in Understanding the tcl proc

proc explore_help {} {
	set channel [open "home/scripts/explorer.readme" "r"]	
	while { [ gets $channel signame ] >= 0 } {
		puts "$signame";
	}
	close $channel
}

Hello,
I need help in understanding this proc. This is a proc to display readme file to explain the functions of the explorer script. What is the meaning of the commands inside the while loop? Please help, thanks

The tcl gets command in this form reads a line from the file associated with the file descriptor assigned to the variable named channel , places the line read into a variable named signame and returns the number of bytes read from the file or -1 on error or EOF. (See the tcl gets man page for details.)

The tcl puts command in this form writes the data in the variable named signame to standard output. (See the tcl puts man page for details.)

1 Like