NAME
TclGetOpenFile - Get a standard IO File * handle from a channel. (Unix
only)SYNOPSIS
##iinncclluuddee <
int TTccllGGeettOOppeennFFiillee(interp, string, write, checkUsage, filePtr) AARRGGUUMMEENNTTSS TclInterp *interp (in) Tcl interpreter from which file handle is to be obtained. CONST char *string (in) String identifying channel, such as ssttddiinn or ffiillee44.> int write (in) Non-zero means the file will be
used for writing, zero means it will be used for reading.int checkUsage (in) If non-zero, then an error will be
generated if the file wasn't opened for the access indicated by write. ClientData *filePtr (out) Points to word in which to store pointer to FILE structure for the file given by string.DESCRIPTION
TTccllGGeettOOppeennFFiillee takes as argument a file identifier of the form returned by the ooppeenn command and returns at *filePtr a pointer to the FILE structure for the file. The write argument indicates whether the FILE pointer will be used for reading or writing. In some cases, such as a channel that connects to a pipeline of subprocesses, differentFILE pointers will be returned for reading and writing. TTccllGGeettOOppeenn-
FFiillee normally returns TCLOK. If an error occurs in TTccllGGeettOOppeennFFiillee (e.g. string didn't make any sense or checkUsage was set and the filewasn't opened for the access specified by write) then TCLERROR is
returned and the interpreter's result will contain an error message. In the current implementation checkUsage is ignored and consistency checks are always performed. | Note that this interface is only supported on the Unix platform. KKEEYYWWOORRDDSS channel, file handle, permissions, pipeline, read, write Tcl 8.0 TclGetOpenFile(3)