Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/doc/GetOpnFl.3 @ 25

Last change on this file since 25 was 25, checked in by landauf, 16 years ago

added tcl to libs

File size: 2.1 KB
Line 
1'\"
2'\" Copyright (c) 1996-1997 Sun Microsystems, Inc.
3'\"
4'\" See the file "license.terms" for information on usage and redistribution
5'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
6'\"
7'\" RCS: @(#) $Id: GetOpnFl.3,v 1.14 2007/12/13 15:22:31 dgp Exp $
8.so man.macros
9.TH Tcl_GetOpenFile 3 8.0 Tcl "Tcl Library Procedures"
10.BS
11.SH NAME
12Tcl_GetOpenFile \- Return a FILE* for a channel registered in the given interpreter (Unix only)
13.SH SYNOPSIS
14.nf
15\fB#include <tcl.h>\fR
16.sp
17int
18\fBTcl_GetOpenFile\fR(\fIinterp, chanID, write, checkUsage, filePtr\fR)
19.sp
20.SH ARGUMENTS
21.AS Tcl_Interp checkUsage out
22.AP Tcl_Interp *interp in
23Tcl interpreter from which file handle is to be obtained.
24.AP "const char" *chanID in
25String identifying channel, such as \fBstdin\fR or \fBfile4\fR.
26.AP int write in
27Non-zero means the file will be used for writing, zero means it will
28be used for reading.
29.AP int checkUsage in
30If non-zero, then an error will be generated if the file was not opened
31for the access indicated by \fIwrite\fR.
32.AP ClientData *filePtr out
33Points to word in which to store pointer to FILE structure for
34the file given by \fIchanID\fR.
35.BE
36
37.SH DESCRIPTION
38.PP
39\fBTcl_GetOpenFile\fR takes as argument a file identifier of the form
40returned by the \fBopen\fR command and
41returns at \fI*filePtr\fR a pointer to the FILE structure for
42the file.
43The \fIwrite\fR argument indicates whether the FILE pointer will
44be used for reading or writing.
45In some cases, such as a channel that connects to a pipeline of
46subprocesses, different FILE pointers will be returned for reading
47and writing.
48\fBTcl_GetOpenFile\fR normally returns \fBTCL_OK\fR.
49If an error occurs in \fBTcl_GetOpenFile\fR (e.g. \fIchanID\fR did not
50make any sense or \fIcheckUsage\fR was set and the file was not opened
51for the access specified by \fIwrite\fR) then \fBTCL_ERROR\fR is returned
52and the interpreter's result will contain an error message.
53In the current implementation \fIcheckUsage\fR is ignored and consistency
54checks are always performed.
55.PP
56Note that this interface is only supported on the Unix platform.
57
58.SH KEYWORDS
59channel, file handle, permissions, pipeline, read, write
Note: See TracBrowser for help on using the repository browser.