Version 1 of seek

Updated 2003-07-08 15:29:23

http://www.purl.org/tcl/home/man/tcl8.4/TclCmd/seek.htm

Example (no error handling done here - be sure to do some in real life!) :

 % cat /tmp/mydata
 1234567890abcdefghijklmnopqrstuvwxyz
 % set f [open "/tmp/mydata" "r+"]
 file3
 % seek $f 20
 % puts -nonewline $f "KLM"
 % close $f
 % cat /tmp/mydata
 1234567890abcdefghijKLMnopqrstuvwxyz

Tcl syntax help - Arts and crafts of Tcl-Tk programming - Category Command