## Tcl8.6.17/Tk8.6.17 Documentation > Tcl Commands > tell

### Tcl/Tk Applications | Tcl Commands | Tk Commands | [incr Tcl] Package Commands | SQLite3 Package Commands | TDBC Package Commands | tdbc::mysql Package Commands | tdbc::odbc Package Commands | tdbc::postgres Package Commands | tdbc::sqlite3 Package Commands | Thread Package Commands | Tcl C API | Tk C API | [incr Tcl] Package C API | TDBC Package C API

### NAME

tell — 開いている通信路の為の現在の利用場所を返す Return current access position for an open channel

### 構文 SYNOPSIS

tell channelId

### 説明 DESCRIPTION

channelId の中の現在の利用位置を与える整数文字列を返す｡この返った値は､その通信路を特定の位置に設定するために seek 命令に渡すことのできるバイトの偏寄値である｡註意すべきは､この値はバイトで表し､ read 命令の様に文字単位ではない｡捜索に対応していない通信路では返って来る値は -1である｡ 　　 Returns an integer string giving the current access position in channelId. This value returned is a byte offset that can be passed to seek in order to set the channel to a particular position. Note that this value is in terms of bytes, not characters like read. The value returned is -1 for channels that do not support seeking.

channelId は､Tcl 標準通信路(stdin か stdout か stderr)の為に開かれた通信路の為の識別子か､又は､ open や socket の起動からの返り値か､又は､Tcl 拡張によってもたらされた命令が作成した通信路の返り値でなければならない｡ ChannelId must be an identifier for an open channel such as a Tcl standard channel (stdin, stdout, or stderr), the return value from an invocation of open or socket, or the result of a channel creation command provided by a Tcl extension.

### 用例 EXAMPLE

ファイル通信路から foobar で始まる場合のみ行を読込む:　　　 　 Read a line from a file channel only if it starts with foobar:

    # 読込みをやり直す場合に備え偏寄を保存する....
    # Save the offset in case we need to undo the read...
    set offset [tell $chan]
    if {[read $chan 6] eq "foobar"} {
        gets $chan line
    } else {
        set line {}
        # 読込みをやり直す...
        # Undo the read...
        seek $chan $offset
    }

### SEE ALSO

file, open, close, gets, seek, Tcl_StandardChannels

### KEYWORDS

access position, channel, seeking
Copyright © 1993 The Regents of the University of California.
Copyright © 1994-1996 Sun Microsystems, Inc.