Skip to content
Tcl Source Code Artifact [ee07b8785f]
Login

Artifact [ee07b8785f]

Artifact ee07b8785ffecd717b2696bbd428a331747e65d2:

Ticket change [ee07b8785f] - New ticket [218484ffffffffff|218484ffff] <i>can&#39;t use [catch {close $pipe}] to get the exit status of t</i>. by nobody on 2000-10-26 01:01:07.
D 2000-10-26T01:01:07
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s692\sBug\nVersion:\s8.0.3\nSubmitDate:\s'1998-10-02'\nLastModified:\s'1999-12-03'\nSeverity:\sSER\nStatus:\sReleased\nSubmitter:\shershey\nChangedBy:\shobbs\nOS:\sAll\nOSVersion:\sNA\nMachine:\sNA\nFixedDate:\s'1999-12-03'\nFixedInVersion:\s8.0.5\nClosedDate:\s'2000-10-25'\n\n\nFollowing\sexamples\sdiscussed\sin\sc.l.t,\sand\sdocumented\sat\n<URL:\sftp://ftp.neosoft.com/pub/tcl/sorted/text/tclarch.txt>,\sI've\nbeen\susing\s[open\s|]\s+\s[fileevent]\sfor\sinter-process\scommunication,\nand\sI've\sused\s[catch\s{close\s$pipe}]\sto\sget\sthe\sexit\sstatus\sof\sthe\nchild\sprocess.\s\sI'm\ssad\sto\sreport\sthat\sthis\smechanism\sis\sbroken\nin\sTcl\s8.0.3,\sas\sthe\sfollowing\sshort\sexample\swill\sdemonstrate:\n\nvisage:tmp:\scat\schild.tcl\s\n#!/bin/sh\s\n#\s\sexec\stclsh\s"$0"\s${1+"$@"}\nputs\sstderr\s"Msg\sto\sstderr"\nputs\sstdout\s"Msg\sto\sstdout"\nexit\s1\n\nvisage:tmp:\scat\sparent.tcl\n#!/bin/sh\n#\s\sexec\stclsh\s"$0"\s${1+"$@"}\nputs\s"Tcl\spatch\slevel:\s[info\spatchlevel]"\nproc\sHandler\s{f}\s{\n\s\s\s\sif\s{[gets\s$f\sline]<0}\s{\n\s\s\s\s\s\s\s\sglobal\sExecDone\serrorCode\n\s\s\s\s\s\s\s\sif\s{[catch\s{close\s$f}\sres]}\s{\n\s\s\s\s\s\s\s\s\s\s\s\sset\sExecDone\s[list\s1\s$res\s$errorCode]\n\s\s\s\s\s\s\s\s}\selse\s{\n\s\s\s\s\s\s\s\s\s\s\s\sset\sExecDone\s[list\s0]\n\s\s\s\s\s\s\s\s}\n\s\s\s\s\s\s\s\sreturn\n\s\s\s\s}\n\s\s\s\sputs\s$line\n}\nset\sf\s[open\s[concat\s|\s2>@\sstderr\schild.tcl]\sr]\nfileevent\s$f\sreadable\s[list\sHandler\s$f]\nvwait\sExecDone\nif\s{[lindex\s$ExecDone\s0]}\s{\n\s\s\s\sputs\sstderr\s"ERROR:\s[lindex\s$ExecDone\s1]"\n\s\s\s\sputs\sstderr\s"CODE:\s[lindex\s$ExecDone\s2]"\n}\n\nvisage:tmp:\s./parent.tcl\s\nTcl\spatch\slevel:\s8.0p2\nMsg\sto\sstderr\nMsg\sto\sstdout\nERROR:\schild\sprocess\sexited\sabnormally\nCODE:\sCHILDSTATUS\s3299\s1\n\nsycamore:tmp:\s./parent.tcl\s\nTcl\spatch\slevel:\s8.0.3\nMsg\sto\sstderr\nMsg\sto\sstdout\n\nThis\sinconsistency\sbreaks\sexisting\sscripts,\sand\sseemingly\sprevents\na\sparent\sprocess\sfrom\sgathering\sthe\sexit\sstatus\sof\sits\schild\swhen\nthey\sare\sconnected\svia\sa\spipeline.\n\nDon\sPorter\n\n\n\nResults\sfrom\s8.0.5:\n\nop\s[~/tmp/auto]\s140\s%\s./parent.tcl\s\nTcl\spatch\slevel:\s8.0.5\nMsg\sto\sstderr\nMsg\sto\sstdout\nERROR:\schild\sprocess\sexited\sabnormally\nCODE:\sCHILDSTATUS\s16122\s1\n\nAs\sdesired.\s\n--\s12/03/1999\shobbs
J foundin obsolete:\s8.0.3
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 60.\sNRE\sand\scoroutines
J title can't\suse\s\s[catch\s{close\s$pipe}]\sto\sget\sthe\sexit\sstatus\sof\st
J type Bug
K 218484ffffffffffffffffffffffffffffffffff
U nobody
Z 12c3a3709bf155070ca6b1c8f8202d3d