chan blocked

Tests whether the last read of a channel stopped for want of data.

chan blocked CHAN

Description

Gives 1 when the last read of a channel with -blocking 0 had too few data, else 0.

Arguments

ArgumentTypeDefaultDescription
CHANchannelrequiredThe channel.

Returns

1 or 0.

Examples

% set f [open a.txt w]; chan close $f
> set f [open a.txt]
> set r [chan blocked $f]
> chan close $f
> set r
0

Errors

% chan blocked 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

See also