Re: Problem in calling c programs and compiling them in tcl/tk
- From: Neil Madden <nem@xxxxxxxxxxxxx>
- Date: Tue, 11 Nov 2008 16:03:38 +0000
Alexandre Ferrieux wrote:
On Nov 11, 11:23 am, vasavi.n...@xxxxxxxxx wrote:Hello,
I have been assigned to open a directory with c
programs in it using tcl/tk. Later I am supposed to c ompile all those
c programs in that directory one after another using tclk/tk.
I am able to open the directory and read all the c files. But when it
comes to compiling them am not able to do it at all. I have tried
using exec gcc filename.c and later exec ./a.out filename.c. For
example , if i take helloworld.c program & write above 2 steps , its
showing the o/p as "helloworld" . But it's also saying like child
process exited abnormally. Please can one suggest a simple command to
execute c programs . All the fork and thread concepts are quite new
and confusing to me. Isn't there any simple command in tcl from which
i can call a c program and compile it ?
I have spent nearly 4 days about this problem.But no idea at all.
Please if anyone can solve this , reply soon , if possible with an
example . I am supposed to complete it with in 1 day more.
You're being hit by the one single worst design mistake in Tcl's
history: the fact that [exec] barfs by default if the child process
writes to its stderr. That's stupid, idiot, dumb, and criminal. That
helped detect errors in one or two long-dead programs that failed to
use their exit status for abnormal exits, and that has spoilt the Tcl
experience of just about everyone else ever since :-)
The fix is trivial: [exec ... 2>@ stderr].
Or [exec -ignorestderr ...]
As you say, the workaround is trivial, and you can easily wrap it:
interp alias {} myexec {} exec -ignorestderr
If the "single worst design mistake in Tcl" is really something with a trivial 1-line fix, then Tcl must surely be perfection!
-- Neil
.
- Follow-Ups:
- Re: Problem in calling c programs and compiling them in tcl/tk
- From: Alexandre Ferrieux
- Re: Problem in calling c programs and compiling them in tcl/tk
- References:
- Problem in calling c programs and compiling them in tcl/tk
- From: vasavi . naga
- Re: Problem in calling c programs and compiling them in tcl/tk
- From: Alexandre Ferrieux
- Problem in calling c programs and compiling them in tcl/tk
- Prev by Date: Re: How can i use a tktable to show the data I've got from the Oracle database?
- Next by Date: Tcl-URL! - weekly Tcl news and links (Nov 11)
- Previous by thread: Re: Problem in calling c programs and compiling them in tcl/tk
- Next by thread: Re: Problem in calling c programs and compiling them in tcl/tk
- Index(es):
Relevant Pages
|