chan tell
Gives the place of the next read or write of a channel.
chan tell CHAN
Description
Gives the place of CHAN in bytes from its start, or -1 for a channel with no place, such as a pipe.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| CHAN | channel | required | The channel. |
Returns
An integer.
Examples
% set f [open a.txt w]; chan puts $f hello; chan close $f
> set f [open a.txt]
> chan read $f 2
> set t [chan tell $f]
> chan close $f
> set t
2
Errors
% chan tell nochan
can not find channel named "nochan"
-errorcode TCL LOOKUP CHANNEL nochan
Facts
- Capability
channels. A new interpreter does not have it until the host turns it on.- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztcl 1.0.0-beta.1