2 '\" Copyright (c) 1993 The Regents of the University of California.
3 '\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
5 '\" See the file "license.terms" for information on usage and redistribution
6 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8 .TH tell n 8.1 Tcl "Tcl Built-In Commands"
11 '\" Note: do not modify the .SH NAME line immediately below!
13 tell \- Return current access position for an open channel
15 \fBtell \fIchannelId\fR
19 Returns an integer string giving the current access position in
20 \fIchannelId\fR. This value returned is a byte offset that can be passed to
21 \fBseek\fR in order to set the channel to a particular position. Note
22 that this value is in terms of bytes, not characters like \fBread\fR.
23 The value returned is -1 for channels that do not support
26 \fIChannelId\fR must be an identifier for an open channel such as a
27 Tcl standard channel (\fBstdin\fR, \fBstdout\fR, or \fBstderr\fR),
28 the return value from an invocation of \fBopen\fR or \fBsocket\fR, or
29 the result of a channel creation command provided by a Tcl extension.
32 Read a line from a file channel only if it starts with \fBfoobar\fR:
35 # Save the offset in case we need to undo the read...
36 set offset [\fBtell\fR $chan]
37 if {[read $chan 6] eq "foobar"} {
46 file(n), open(n), close(n), gets(n), seek(n), Tcl_StandardChannels(3)
48 access position, channel, seeking