Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / src / nas,5.n2.os.2 / lib / python / man / mann / open.n
CommitLineData
86530b38
AT
1'\"
2'\" Copyright (c) 1993 The Regents of the University of California.
3'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4'\"
5'\" See the file "license.terms" for information on usage and redistribution
6'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7'\"
8'\" RCS: @(#) $Id: open.n,v 1.16.2.3 2005/04/19 16:30:21 davygrvy Exp $
9'\"
10'\" The definitions below are for supplemental macros used in Tcl/Tk
11'\" manual entries.
12'\"
13'\" .AP type name in/out ?indent?
14'\" Start paragraph describing an argument to a library procedure.
15'\" type is type of argument (int, etc.), in/out is either "in", "out",
16'\" or "in/out" to describe whether procedure reads or modifies arg,
17'\" and indent is equivalent to second arg of .IP (shouldn't ever be
18'\" needed; use .AS below instead)
19'\"
20'\" .AS ?type? ?name?
21'\" Give maximum sizes of arguments for setting tab stops. Type and
22'\" name are examples of largest possible arguments that will be passed
23'\" to .AP later. If args are omitted, default tab stops are used.
24'\"
25'\" .BS
26'\" Start box enclosure. From here until next .BE, everything will be
27'\" enclosed in one large box.
28'\"
29'\" .BE
30'\" End of box enclosure.
31'\"
32'\" .CS
33'\" Begin code excerpt.
34'\"
35'\" .CE
36'\" End code excerpt.
37'\"
38'\" .VS ?version? ?br?
39'\" Begin vertical sidebar, for use in marking newly-changed parts
40'\" of man pages. The first argument is ignored and used for recording
41'\" the version when the .VS was added, so that the sidebars can be
42'\" found and removed when they reach a certain age. If another argument
43'\" is present, then a line break is forced before starting the sidebar.
44'\"
45'\" .VE
46'\" End of vertical sidebar.
47'\"
48'\" .DS
49'\" Begin an indented unfilled display.
50'\"
51'\" .DE
52'\" End of indented unfilled display.
53'\"
54'\" .SO
55'\" Start of list of standard options for a Tk widget. The
56'\" options follow on successive lines, in four columns separated
57'\" by tabs.
58'\"
59'\" .SE
60'\" End of list of standard options for a Tk widget.
61'\"
62'\" .OP cmdName dbName dbClass
63'\" Start of description of a specific option. cmdName gives the
64'\" option's name as specified in the class command, dbName gives
65'\" the option's name in the option database, and dbClass gives
66'\" the option's class in the option database.
67'\"
68'\" .UL arg1 arg2
69'\" Print arg1 underlined, then print arg2 normally.
70'\"
71'\" RCS: @(#) $Id: man.macros,v 1.4 2000/08/25 06:18:32 ericm Exp $
72'\"
73'\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
74.if t .wh -1.3i ^B
75.nr ^l \n(.l
76.ad b
77'\" # Start an argument description
78.de AP
79.ie !"\\$4"" .TP \\$4
80.el \{\
81. ie !"\\$2"" .TP \\n()Cu
82. el .TP 15
83.\}
84.ta \\n()Au \\n()Bu
85.ie !"\\$3"" \{\
86\&\\$1 \\fI\\$2\\fP (\\$3)
87.\".b
88.\}
89.el \{\
90.br
91.ie !"\\$2"" \{\
92\&\\$1 \\fI\\$2\\fP
93.\}
94.el \{\
95\&\\fI\\$1\\fP
96.\}
97.\}
98..
99'\" # define tabbing values for .AP
100.de AS
101.nr )A 10n
102.if !"\\$1"" .nr )A \\w'\\$1'u+3n
103.nr )B \\n()Au+15n
104.\"
105.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
106.nr )C \\n()Bu+\\w'(in/out)'u+2n
107..
108.AS Tcl_Interp Tcl_CreateInterp in/out
109'\" # BS - start boxed text
110'\" # ^y = starting y location
111'\" # ^b = 1
112.de BS
113.br
114.mk ^y
115.nr ^b 1u
116.if n .nf
117.if n .ti 0
118.if n \l'\\n(.lu\(ul'
119.if n .fi
120..
121'\" # BE - end boxed text (draw box now)
122.de BE
123.nf
124.ti 0
125.mk ^t
126.ie n \l'\\n(^lu\(ul'
127.el \{\
128.\" Draw four-sided box normally, but don't draw top of
129.\" box if the box started on an earlier page.
130.ie !\\n(^b-1 \{\
131\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
132.\}
133.el \}\
134\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
135.\}
136.\}
137.fi
138.br
139.nr ^b 0
140..
141'\" # VS - start vertical sidebar
142'\" # ^Y = starting y location
143'\" # ^v = 1 (for troff; for nroff this doesn't matter)
144.de VS
145.if !"\\$2"" .br
146.mk ^Y
147.ie n 'mc \s12\(br\s0
148.el .nr ^v 1u
149..
150'\" # VE - end of vertical sidebar
151.de VE
152.ie n 'mc
153.el \{\
154.ev 2
155.nf
156.ti 0
157.mk ^t
158\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
159.sp -1
160.fi
161.ev
162.\}
163.nr ^v 0
164..
165'\" # Special macro to handle page bottom: finish off current
166'\" # box/sidebar if in box/sidebar mode, then invoked standard
167'\" # page bottom macro.
168.de ^B
169.ev 2
170'ti 0
171'nf
172.mk ^t
173.if \\n(^b \{\
174.\" Draw three-sided box if this is the box's first page,
175.\" draw two sides but no top otherwise.
176.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
177.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
178.\}
179.if \\n(^v \{\
180.nr ^x \\n(^tu+1v-\\n(^Yu
181\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
182.\}
183.bp
184'fi
185.ev
186.if \\n(^b \{\
187.mk ^y
188.nr ^b 2
189.\}
190.if \\n(^v \{\
191.mk ^Y
192.\}
193..
194'\" # DS - begin display
195.de DS
196.RS
197.nf
198.sp
199..
200'\" # DE - end display
201.de DE
202.fi
203.RE
204.sp
205..
206'\" # SO - start of list of standard options
207.de SO
208.SH "STANDARD OPTIONS"
209.LP
210.nf
211.ta 5.5c 11c
212.ft B
213..
214'\" # SE - end of list of standard options
215.de SE
216.fi
217.ft R
218.LP
219See the \\fBoptions\\fR manual entry for details on the standard options.
220..
221'\" # OP - start of full description for a single option
222.de OP
223.LP
224.nf
225.ta 4c
226Command-Line Name: \\fB\\$1\\fR
227Database Name: \\fB\\$2\\fR
228Database Class: \\fB\\$3\\fR
229.fi
230.IP
231..
232'\" # CS - begin code excerpt
233.de CS
234.RS
235.nf
236.ta .25i .5i .75i 1i
237..
238'\" # CE - end code excerpt
239.de CE
240.fi
241.RE
242..
243.de UL
244\\$1\l'|0\(ul'\\$2
245..
246.TH open n 8.3 Tcl "Tcl Built-In Commands"
247.BS
248'\" Note: do not modify the .SH NAME line immediately below!
249.SH NAME
250open \- Open a file-based or command pipeline channel
251.SH SYNOPSIS
252.sp
253\fBopen \fIfileName\fR
254.br
255\fBopen \fIfileName access\fR
256.br
257\fBopen \fIfileName access permissions\fR
258.BE
259
260.SH DESCRIPTION
261.PP
262This command opens a file, serial port, or command pipeline and returns a
263channel identifier that may be used in future invocations of commands like
264\fBread\fR, \fBputs\fR, and \fBclose\fR.
265If the first character of \fIfileName\fR is not \fB|\fR then
266the command opens a file:
267\fIfileName\fR gives the name of the file to open, and it must conform to the
268conventions described in the \fBfilename\fR manual entry.
269.PP
270The \fIaccess\fR argument, if present, indicates the way in which the file
271(or command pipeline) is to be accessed.
272In the first form \fIaccess\fR may have any of the following values:
273.TP 15
274\fBr\fR
275Open the file for reading only; the file must already exist. This is the
276default value if \fIaccess\fR is not specified.
277.TP 15
278\fBr+\fR
279Open the file for both reading and writing; the file must
280already exist.
281.TP 15
282\fBw\fR
283Open the file for writing only. Truncate it if it exists. If it doesn't
284exist, create a new file.
285.TP 15
286\fBw+\fR
287Open the file for reading and writing. Truncate it if it exists.
288If it doesn't exist, create a new file.
289.TP 15
290\fBa\fR
291Open the file for writing only. If the file doesn't exist,
292create a new empty file.
293Set the initial access position to the end of the file.
294.TP 15
295\fBa+\fR
296Open the file for reading and writing. If the file doesn't exist,
297create a new empty file.
298Set the initial access position to the end of the file.
299.PP
300In the second form, \fIaccess\fR consists of a list of any of the
301following flags, all of which have the standard POSIX meanings.
302One of the flags must be either \fBRDONLY\fR, \fBWRONLY\fR or \fBRDWR\fR.
303.TP 15
304\fBRDONLY\fR
305Open the file for reading only.
306.TP 15
307\fBWRONLY\fR
308Open the file for writing only.
309.TP 15
310\fBRDWR\fR
311Open the file for both reading and writing.
312.TP 15
313\fBAPPEND\fR
314Set the file pointer to the end of the file prior to each write.
315.TP 15
316\fBCREAT\fR
317Create the file if it doesn't already exist (without this flag it
318is an error for the file not to exist).
319.TP 15
320\fBEXCL\fR
321If \fBCREAT\fR is also specified, an error is returned if the
322file already exists.
323.TP 15
324\fBNOCTTY\fR
325If the file is a terminal device, this flag prevents the file from
326becoming the controlling terminal of the process.
327.TP 15
328\fBNONBLOCK\fR
329Prevents the process from blocking while opening the file, and
330possibly in subsequent I/O operations. The exact behavior of
331this flag is system- and device-dependent; its use is discouraged
332(it is better to use the \fBfconfigure\fR command to put a file
333in nonblocking mode).
334For details refer to your system documentation on the \fBopen\fR system
335call's \fBO_NONBLOCK\fR flag.
336.TP 15
337\fBTRUNC\fR
338If the file exists it is truncated to zero length.
339.PP
340If a new file is created as part of opening it, \fIpermissions\fR
341(an integer) is used to set the permissions for the new file in
342conjunction with the process's file mode creation mask.
343\fIPermissions\fR defaults to 0666.
344.PP
345Note that if you are going to be reading or writing binary data from
346the channel created by this command, you should use the
347\fBfconfigure\fR command to change the \fB-translation\fR option of
348the channel to \fBbinary\fR before transferring any binary data. This
349is in contrast to the ``b'' character passed as part of the equivalent
350of the \fIaccess\fR parameter to some versions of the C library
351\fIfopen()\fR function.
352
353.SH "COMMAND PIPELINES"
354.PP
355If the first character of \fIfileName\fR is ``|'' then the
356remaining characters of \fIfileName\fR are treated as a list of arguments
357that describe a command pipeline to invoke, in the same style as the
358arguments for \fBexec\fR.
359In this case, the channel identifier returned by \fBopen\fR may be used
360to write to the command's input pipe or read from its output pipe,
361depending on the value of \fIaccess\fR.
362If write-only access is used (e.g. \fIaccess\fR is \fBw\fR), then
363standard output for the pipeline is directed to the current standard
364output unless overridden by the command.
365If read-only access is used (e.g. \fIaccess\fR is \fBr\fR),
366standard input for the pipeline is taken from the current standard
367input unless overridden by the command.
368The id of the spawned process is accessible through the \fBpid\fR
369command, using the channel id returned by \fBopen\fR as argument.
370.PP
371If the command (or one of the commands) executed in the command
372pipeline returns an error (according to the definition in \fBexec\fR),
373a Tcl error is generated when \fBclose\fR is called on the channel
374unless the pipeline is in non-blocking mode then no exit status is
375returned (a silent \fBclose\fR with -blocking 0).
376.PP
377It is often useful to use the \fBfileevent\fR command with pipelines
378so other processing may happen at the same time as running the command
379in the background.
380.VS 8.4
381.SH "SERIAL COMMUNICATIONS"
382.PP
383If \fIfileName\fR refers to a serial port, then the specified serial port
384is opened and initialized in a platform-dependent manner. Acceptable
385values for the \fIfileName\fR to use to open a serial port are described in
386the PORTABILITY ISSUES section.
387.PP
388The \fBfconfigure\fR command can be used to query and set additional
389configuration options specific to serial ports (where supported):
390.TP
391\fB\-mode\fR \fIbaud\fB,\fIparity\fB,\fIdata\fB,\fIstop\fR
392This option is a set of 4 comma-separated values: the baud rate, parity,
393number of data bits, and number of stop bits for this serial port. The
394\fIbaud\fR rate is a simple integer that specifies the connection speed.
395\fIParity\fR is one of the following letters: \fBn\fR, \fBo\fR, \fBe\fR,
396\fBm\fR, \fBs\fR; respectively signifying the parity options of ``none'',
397``odd'', ``even'', ``mark'', or ``space''. \fIData\fR is the number of
398data bits and should be an integer from 5 to 8, while \fIstop\fR is the
399number of stop bits and should be the integer 1 or 2.
400.TP
401\fB\-handshake\fR \fItype\fR
402(Windows and Unix). This option is used to setup automatic handshake
403control. Note that not all handshake types maybe supported by your operating
404system. The \fItype\fR parameter is case-independent.
405.sp
406If \fItype\fR is \fBnone\fR then any handshake is switched off.
407\fBrtscts\fR activates hardware handshake. Hardware handshake signals
408are described below.
409For software handshake \fBxonxoff\fR the handshake characters can be redefined
410with \fB-xchar\fR.
411An additional hardware handshake \fBdtrdsr\fR is available only under Windows.
412There is no default handshake configuration, the initial value depends
413on your operating system settings.
414The \fB-handshake\fR option cannot be queried.
415.TP
416\fB\-queue\fR
417(Windows and Unix). The \fB-queue\fR option can only be queried.
418It returns a list of two integers representing the current number
419of bytes in the input and output queue respectively.
420.TP
421\fB\-timeout\fR \fImsec\fR
422(Windows and Unix). This option is used to set the timeout for blocking
423read operations. It specifies the maximum interval between the
424reception of two bytes in milliseconds.
425For Unix systems the granularity is 100 milliseconds.
426The \fB-timeout\fR option does not affect write operations or
427nonblocking reads.
428This option cannot be queried.
429.TP
430\fB\-ttycontrol\fR \fI{signal boolean signal boolean ...}\fR
431(Windows and Unix). This option is used to setup the handshake
432output lines (see below) permanently or to send a BREAK over the serial line.
433The \fIsignal\fR names are case-independent.
434\fB{RTS 1 DTR 0}\fR sets the RTS output to high and the DTR output to low.
435The BREAK condition (see below) is enabled and disabled with \fB{BREAK 1}\fR and
436\fB{BREAK 0}\fR respectively.
437It's not a good idea to change the \fBRTS\fR (or \fBDTR\fR) signal
438with active hardware handshake \fBrtscts\fR (or \fBdtrdsr\fR).
439The result is unpredictable.
440The \fB-ttycontrol\fR option cannot be queried.
441.TP
442\fB\-ttystatus\fR
443(Windows and Unix). The \fB-ttystatus\fR option can only be
444queried. It returns the current modem status and handshake input signals
445(see below).
446The result is a list of signal,value pairs with a fixed order,
447e.g. \fB{CTS 1 DSR 0 RING 1 DCD 0}\fR.
448The \fIsignal\fR names are returned upper case.
449.TP
450\fB\-xchar\fR \fI{xonChar xoffChar}\fR
451(Windows and Unix). This option is used to query or change the software
452handshake characters. Normally the operating system default should be
453DC1 (0x11) and DC3 (0x13) representing the ASCII standard
454XON and XOFF characters.
455.TP
456\fB\-pollinterval\fR \fImsec\fR
457(Windows only). This option is used to set the maximum time between
458polling for fileevents.
459This affects the time interval between checking for events throughout the Tcl
460interpreter (the smallest value always wins). Use this option only if
461you want to poll the serial port more or less often than 10 msec
462(the default).
463.TP
464\fB\-sysbuffer\fR \fIinSize\fR
465.TP
466\fB\-sysbuffer\fR \fI{inSize outSize}\fR
467(Windows only). This option is used to change the size of Windows
468system buffers for a serial channel. Especially at higher communication
469rates the default input buffer size of 4096 bytes can overrun
470for latent systems. The first form specifies the input buffer size,
471in the second form both input and output buffers are defined.
472.TP
473\fB\-lasterror\fR
474(Windows only). This option is query only.
475In case of a serial communication error, \fBread\fR or \fBputs\fR
476returns a general Tcl file I/O error.
477\fBfconfigure -lasterror\fR can be called to get a list of error details.
478See below for an explanation of the various error codes.
479
480.SH "SERIAL PORT SIGNALS"
481.PP
482RS-232 is the most commonly used standard electrical interface for serial
483communications. A negative voltage (-3V..-12V) define a mark (on=1) bit and
484a positive voltage (+3..+12V) define a space (off=0) bit (RS-232C). The
485following signals are specified for incoming and outgoing data, status
486lines and handshaking. Here we are using the terms \fIworkstation\fR for
487your computer and \fImodem\fR for the external device, because some signal
488names (DCD, RI) come from modems. Of course your external device may use
489these signal lines for other purposes.
490
491.IP \fBTXD(output)\fR
492\fBTransmitted Data:\fR Outgoing serial data.
493.IP \fBRXD(input)\fR
494\fBReceived Data:\fRIncoming serial data.
495.IP \fBRTS(output)\fR
496\fBRequest To Send:\fR This hardware handshake line informs the modem that
497your workstation is ready to receive data. Your workstation may
498automatically reset this signal to indicate that the input buffer is full.
499.IP \fBCTS(input)\fR
500\fBClear To Send:\fR The complement to RTS. Indicates that the modem is
501ready to receive data.
502.IP \fBDTR(output)\fR
503\fBData Terminal Ready:\fR This signal tells the modem that the workstation
504is ready to establish a link. DTR is often enabled automatically whenever a
505serial port is opened.
506.IP \fBDSR(input)\fR
507\fBData Set Ready:\fR The complement to DTR. Tells the workstation that the
508modem is ready to establish a link.
509.IP \fBDCD(input)\fR
510\fBData Carrier Detect:\fR This line becomes active when a modem detects
511a "Carrier" signal.
512.IP \fBRI(input)\fR
513\fBRing Indicator:\fR Goes active when the modem detects an incoming call.
514.IP \fBBREAK\fR
515A BREAK condition is not a hardware signal line, but a logical zero on the
516TXD or RXD lines for a long period of time, usually 250 to 500
517milliseconds. Normally a receive or transmit data signal stays at the mark
518(on=1) voltage until the next character is transferred. A BREAK is sometimes
519used to reset the communications line or change the operating mode of
520communications hardware.
521
522.SH "ERROR CODES (Windows only)"
523.PP
524A lot of different errors may occur during serial read operations or during
525event polling in background. The external device may have been switched
526off, the data lines may be noisy, system buffers may overrun or your mode
527settings may be wrong. That's why a reliable software should always
528\fBcatch\fR serial read operations. In cases of an error Tcl returns a
529general file I/O error. Then \fBfconfigure -lasterror\fR may help to
530locate the problem. The following error codes may be returned.
531
532.TP 10
533\fBRXOVER\fR
534Windows input buffer overrun. The data comes faster than your scripts reads
535it or your system is overloaded. Use \fBfconfigure -sysbuffer\fR to avoid a
536temporary bottleneck and/or make your script faster.
537.TP 10
538\fBTXFULL\fR
539Windows output buffer overrun. Complement to RXOVER. This error should
540practically not happen, because Tcl cares about the output buffer status.
541.TP 10
542\fBOVERRUN\fR
543UART buffer overrun (hardware) with data lost.
544The data comes faster than the system driver receives it.
545Check your advanced serial port settings to enable the FIFO (16550) buffer
546and/or setup a lower(1) interrupt threshold value.
547.TP 10
548\fBRXPARITY\fR
549A parity error has been detected by your UART.
550Wrong parity settings with \fBfconfigure -mode\fR or a noisy data line (RXD)
551may cause this error.
552.TP 10
553\fBFRAME\fR
554A stop-bit error has been detected by your UART.
555Wrong mode settings with \fBfconfigure -mode\fR or a noisy data line (RXD)
556may cause this error.
557.TP 10
558\fBBREAK\fR
559A BREAK condition has been detected by your UART (see above).
560.VE
561
562.SH "PORTABILITY ISSUES"
563.TP
564\fBWindows \fR(all versions)
565Valid values for \fIfileName\fR to open a serial port are of the form
566\fBcom\fIX\fB:\fR, where \fIX\fR is a number, generally from 1 to 4.
567This notation only works for serial ports from 1 to 9, if the system
568happens to have more than four. An attempt to open a serial port that
569does not exist or has a number greater than 9 will fail. An alternate
570form of opening serial ports is to use the filename \fB\e\e.\ecomX\fR,
571where X is any number that corresponds to a serial port; please note
572that this method is considerably slower on Windows 95 and Windows 98.
573.TP
574\fBWindows NT\fR
575When running Tcl interactively, there may be some strange interactions
576between the real console, if one is present, and a command pipeline that uses
577standard input or output. If a command pipeline is opened for reading, some
578of the lines entered at the console will be sent to the command pipeline and
579some will be sent to the Tcl evaluator. If a command pipeline is opened for
580writing, keystrokes entered into the console are not visible until the
581pipe is closed. This behavior occurs whether the command pipeline is
582executing 16-bit or 32-bit applications. These problems only occur because
583both Tcl and the child application are competing for the console at
584the same time. If the command pipeline is started from a script, so that Tcl
585is not accessing the console, or if the command pipeline does not use
586standard input or output, but is redirected from or to a file, then the
587above problems do not occur.
588.TP
589\fBWindows 95\fR
590A command pipeline that executes a 16-bit DOS application cannot be opened
591for both reading and writing, since 16-bit DOS applications that receive
592standard input from a pipe and send standard output to a pipe run
593synchronously. Command pipelines that do not execute 16-bit DOS
594applications run asynchronously and can be opened for both reading and
595writing.
596.sp
597When running Tcl interactively, there may be some strange interactions
598between the real console, if one is present, and a command pipeline that uses
599standard input or output. If a command pipeline is opened for reading from
600a 32-bit application, some of the keystrokes entered at the console will be
601sent to the command pipeline and some will be sent to the Tcl evaluator. If
602a command pipeline is opened for writing to a 32-bit application, no output
603is visible on the console until the pipe is closed. These problems only
604occur because both Tcl and the child application are competing for the
605console at the same time. If the command pipeline is started from a script,
606so that Tcl is not accessing the console, or if the command pipeline does
607not use standard input or output, but is redirected from or to a file, then
608the above problems do not occur.
609.sp
610Whether or not Tcl is running interactively, if a command pipeline is opened
611for reading from a 16-bit DOS application, the call to \fBopen\fR will not
612return until end-of-file has been received from the command pipeline's
613standard output. If a command pipeline is opened for writing to a 16-bit DOS
614application, no data will be sent to the command pipeline's standard output
615until the pipe is actually closed. This problem occurs because 16-bit DOS
616applications are run synchronously, as described above.
617.TP
618\fBMacintosh\fR
619Opening a serial port is not currently implemented under Macintosh.
620.sp
621Opening a command pipeline is not supported under Macintosh, since
622applications do not support the concept of standard input or output.
623.TP
624\fBUnix\fR\0\0\0\0\0\0\0
625Valid values for \fIfileName\fR to open a serial port are generally of the
626form \fB/dev/tty\fIX\fR, where \fIX\fR is \fBa\fR or \fBb\fR, but the name
627of any pseudo-file that maps to a serial port may be used.
628.VS 8.4
629Advanced configuration options are only supported for serial ports
630when Tcl is built to use the POSIX serial interface.
631.VE 8.4
632.sp
633When running Tcl interactively, there may be some strange interactions
634between the console, if one is present, and a command pipeline that uses
635standard input. If a command pipeline is opened for reading, some
636of the lines entered at the console will be sent to the command pipeline and
637some will be sent to the Tcl evaluator. This problem only occurs because
638both Tcl and the child application are competing for the console at the
639same time. If the command pipeline is started from a script, so that Tcl is
640not accessing the console, or if the command pipeline does not use standard
641input, but is redirected from a file, then the above problem does not occur.
642.LP
643See the PORTABILITY ISSUES section of the \fBexec\fR command for additional
644information not specific to command pipelines about executing
645applications on the various platforms
646.SH "EXAMPLE"
647Open a command pipeline and catch any errors:
648.CS
649set fl [\fBopen\fR "| ls this_file_does_not_exist"]
650set data [read $fl]
651if {[catch {close $fl} err]} {
652 puts "ls command failed: $err"
653}
654.CE
655
656.SH "SEE ALSO"
657file(n), close(n), filename(n), fconfigure(n), gets(n), read(n),
658puts(n), exec(n), pid(n), fopen(3)
659
660.SH KEYWORDS
661access mode, append, create, file, non-blocking, open, permissions,
662pipeline, process, serial