1 |
578 |
markom |
'\"
|
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.1.1.1 2002-01-16 10:25:24 markom Exp $
|
8 |
|
|
.so man.macros
|
9 |
|
|
.TH Tcl_GetOpenFile 3 8.0 Tcl "Tcl Library Procedures"
|
10 |
|
|
.BS
|
11 |
|
|
.SH NAME
|
12 |
|
|
Tcl_GetOpenFile \- Get a standard IO File * handle from a channel. (Unix only)
|
13 |
|
|
.SH SYNOPSIS
|
14 |
|
|
.nf
|
15 |
|
|
\fB#include \fR
|
16 |
|
|
.sp
|
17 |
|
|
int
|
18 |
|
|
\fBTcl_GetOpenFile\fR(\fIinterp, string, write, checkUsage, filePtr\fR)
|
19 |
|
|
.sp
|
20 |
|
|
.SH ARGUMENTS
|
21 |
|
|
.AS Tcl_Interp checkUsage
|
22 |
|
|
.AP Tcl_Interp *interp in
|
23 |
|
|
Tcl interpreter from which file handle is to be obtained.
|
24 |
|
|
.AP char *string in
|
25 |
|
|
String identifying channel, such as \fBstdin\fR or \fBfile4\fR.
|
26 |
|
|
.AP int write in
|
27 |
|
|
Non-zero means the file will be used for writing, zero means it will
|
28 |
|
|
be used for reading.
|
29 |
|
|
.AP int checkUsage in
|
30 |
|
|
If non-zero, then an error will be generated if the file wasn't opened
|
31 |
|
|
for the access indicated by \fIwrite\fR.
|
32 |
|
|
.AP ClientData *filePtr out
|
33 |
|
|
Points to word in which to store pointer to FILE structure for
|
34 |
|
|
the file given by \fIstring\fR.
|
35 |
|
|
.BE
|
36 |
|
|
|
37 |
|
|
.SH DESCRIPTION
|
38 |
|
|
.PP
|
39 |
|
|
\fBTcl_GetOpenFile\fR takes as argument a file identifier of the form
|
40 |
|
|
returned by the \fBopen\fR command and
|
41 |
|
|
returns at \fI*filePtr\fR a pointer to the FILE structure for
|
42 |
|
|
the file.
|
43 |
|
|
The \fIwrite\fR argument indicates whether the FILE pointer will
|
44 |
|
|
be used for reading or writing.
|
45 |
|
|
In some cases, such as a channel that connects to a pipeline of
|
46 |
|
|
subprocesses, different FILE pointers will be returned for reading
|
47 |
|
|
and writing.
|
48 |
|
|
\fBTcl_GetOpenFile\fR normally returns TCL_OK.
|
49 |
|
|
If an error occurs in \fBTcl_GetOpenFile\fR (e.g. \fIstring\fR didn't
|
50 |
|
|
make any sense or \fIcheckUsage\fR was set and the file wasn't opened
|
51 |
|
|
for the access specified by \fIwrite\fR) then TCL_ERROR is returned
|
52 |
|
|
and \fIinterp->result\fR will contain an error message.
|
53 |
|
|
In the current implementation \fIcheckUsage\fR is ignored and consistency
|
54 |
|
|
checks are always performed.
|
55 |
|
|
.VS
|
56 |
|
|
.PP
|
57 |
|
|
Note that this interface is only supported on the Unix platform.
|
58 |
|
|
.VE
|
59 |
|
|
|
60 |
|
|
.SH KEYWORDS
|
61 |
|
|
channel, file handle, permissions, pipeline, read, write
|