GetOpnFl.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:2k
- '"
- '" Copyright (c) 1996-1997 Sun Microsystems, Inc.
- '"
- '" See the file "license.terms" for information on usage and redistribution
- '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '"
- '" RCS: @(#) $Id: GetOpnFl.3,v 1.4 2002/01/23 20:46:01 dgp Exp $
- .so man.macros
- .TH Tcl_GetOpenFile 3 8.0 Tcl "Tcl Library Procedures"
- .BS
- .SH NAME
- Tcl_GetOpenFile - Get a standard IO File * handle from a channel. (Unix only)
- .SH SYNOPSIS
- .nf
- fB#include <tcl.h>fR
- .sp
- int
- fBTcl_GetOpenFilefR(fIinterp, string, write, checkUsage, filePtrfR)
- .sp
- .SH ARGUMENTS
- .AS Tcl_Interp checkUsage
- .AP Tcl_Interp *interp in
- Tcl interpreter from which file handle is to be obtained.
- .AP "CONST char" *string in
- String identifying channel, such as fBstdinfR or fBfile4fR.
- .AP int write in
- Non-zero means the file will be used for writing, zero means it will
- be used for reading.
- .AP int checkUsage in
- If non-zero, then an error will be generated if the file wasn't opened
- for the access indicated by fIwritefR.
- .AP ClientData *filePtr out
- Points to word in which to store pointer to FILE structure for
- the file given by fIstringfR.
- .BE
- .SH DESCRIPTION
- .PP
- fBTcl_GetOpenFilefR takes as argument a file identifier of the form
- returned by the fBopenfR command and
- returns at fI*filePtrfR a pointer to the FILE structure for
- the file.
- The fIwritefR 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, different FILE pointers will be returned for reading
- and writing.
- fBTcl_GetOpenFilefR normally returns TCL_OK.
- If an error occurs in fBTcl_GetOpenFilefR (e.g. fIstringfR didn't
- make any sense or fIcheckUsagefR was set and the file wasn't opened
- for the access specified by fIwritefR) then TCL_ERROR is returned
- and the interpreter's result will contain an error message.
- In the current implementation fIcheckUsagefR is ignored and consistency
- checks are always performed.
- .VS
- .PP
- Note that this interface is only supported on the Unix platform.
- .VE
- .SH KEYWORDS
- channel, file handle, permissions, pipeline, read, write