diff options
Diffstat (limited to 'doc/tell.n')
| -rw-r--r-- | doc/tell.n | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tell n 8.1 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -14,9 +14,10 @@ tell \- Return current access position for an open channel .SH SYNOPSIS \fBtell \fIchannelId\fR .BE + .SH DESCRIPTION .PP -Returns an integer giving the current access position in +Returns an integer string giving the current access position in \fIchannelId\fR. This value returned is a byte offset that can be passed to \fBseek\fR in order to set the channel to a particular position. Note that this value is in terms of bytes, not characters like \fBread\fR. @@ -28,9 +29,7 @@ Tcl standard channel (\fBstdin\fR, \fBstdout\fR, or \fBstderr\fR), the return value from an invocation of \fBopen\fR or \fBsocket\fR, or the result of a channel creation command provided by a Tcl extension. .SH EXAMPLE -.PP Read a line from a file channel only if it starts with \fBfoobar\fR: -.PP .CS # Save the offset in case we need to undo the read... set offset [\fBtell\fR $chan] @@ -42,11 +41,9 @@ if {[read $chan 6] eq "foobar"} { seek $chan $offset } .CE + .SH "SEE ALSO" file(n), open(n), close(n), gets(n), seek(n), Tcl_StandardChannels(3) + .SH KEYWORDS access position, channel, seeking -'\" Local Variables: -'\" mode: nroff -'\" fill-column: 78 -'\" End: |
