Manual Pages for UNIX Darwin command on man Tcl_SetStdChannel
MyWebUniversity

Manual Pages for UNIX Darwin command on man Tcl_SetStdChannel

TclGetStdChannel(3) Tcl Library Procedures TclGetStdChannel(3)

NAME

TclGetStdChannel, TclSetStdChannel - procedures for retrieving and

replacing the standard channels

SYNOPSIS

##iinncclluuddee <>

TclChannel TTccllGGeettSSttddCChhaannnneell(type) TTccllSSeettSSttddCChhaannnneell(channel, type) AARRGGUUMMEENNTTSS

int type (in) The identifier for the standard chan-

nel to retrieve or modify. Must be one of TTCCLLSSTTDDIINN, TTCCLLSSTTDDOOUUTT, or TTCCLLSSTTDDEERRRR. TclChannel channel (in) The channel to use as the new value for the specified standard channel.

DESCRIPTION

Tcl defines three special channels that are used by various I/O related

commands if no other channels are specified. The standard input chan-

nel has a channel name of ssttddiinn and is used by rreeaadd and ggeettss. The

standard output channel is named ssttddoouutt and is used by ppuuttss. The stan-

dard error channel is named ssttddeerrrr and is used for reporting errors. In addition, the standard channels are inherited by any child processes created using eexxeecc or ooppeenn in the absence of any other redirections. The standard channels are actually aliases for other normal channels. The current channel associated with a standard channel can be retrieved by calling TTccllGGeettSSttddCChhaannnneell with one of TTCCLLSSTTDDIINN, TTCCLLSSTTDDOOUUTT, or TTCCLLSSTTDDEERRRR as the type. The return value will be a valid channel, or NULL. A new channel can be set for the standard channel specified by type by calling TTccllSSeettSSttddCChhaannnneell with a new channel or NULL in the channel argument. If the specified channel is closed by a later call to TTccllCClloossee, then the corresponding standard channel will automatically be set to NULL.

If TTccllGGeettSSttddCChhaannnneell is called before TTccllSSeettSSttddCChhaannnneell, Tcl will con-

struct a new channel to wrap the appropriate platform-specific standard

file handle. If TTccllSSeettSSttddCChhaannnneell is called before TTccllGGeettSSttddCChhaannnneell, then the default channel will not be created. If one of the standard channels is set to NULL, either by calling TTccllSSeettSSttddCChhaannnneell with a NULL channel argument, or by calling TTccllCClloossee

on the channel, then the next call to TTccllCCrreeaatteeCChhaannnneell will automati-

cally set the standard channel with the newly created channel. If more than one standard channel is NULL, then the standard channels will be assigned starting with standard input, followed by standard output, with standard error being last. See TTccllSSttaannddaarrddCChhaannnneellss for a general treatise about standard channels and the behaviour of the Tcl library with regard to them.

SEE ALSO

TclClose(3), TclCreateChannel(3), TclMain(3), tclsh(1) KKEEYYWWOORRDDSS standard channel, standard input, standard output, standard error Tcl 7.5 TclGetStdChannel(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™