4590321 [rkeene@sledge /home/rkeene/projects/rivet-cgi/rivet-tcl]$ cat -n read_file.tcl
   1: ###
   2: ## read_file <file>
   3: ##    Read the entire contents of a file and return it as a string.
   4: ##
   5: ##    file - Name of the file to read.
   6: ###
   7: 
   8: proc read_file {file} {
   9:     set fp [open $file]
  10:     set x [read $fp]
  11:     close $fp
  12:     return $x
  13: }
4590322 [rkeene@sledge /home/rkeene/projects/rivet-cgi/rivet-tcl]$

Click here to go back to the directory listing.
Click here to download this file.
last modified: 2002-01-09 15:55:03