From: matz@... (Yukihiro Matsumoto) Date: 2003-05-13T17:43:28+09:00 Subject: Re: RCR for child execution Hi, In message "Re: RCR for child execution" on 03/05/13, "Simon Strandgaard" <0bz63fz3m1qt3001@sneakemail.com> writes: |Still rb_warn and friends outputs to stderr. |I am searching for the nice solution :-) Now it does. In message "Re: RCR for child execution" on 03/05/13, "Simon Strandgaard" <0bz63fz3m1qt3001@sneakemail.com> writes: |void system(command) { | pid=fork(); | if(pid != 0) { | stdout = rb_stdout; /* what im asking for */ | stderr = rb_stderr; /* what im asking for */ | stdin = rb_stdin; /* what im asking for */ | execv(command); | } |} | |OK.. again assignment to stdout is illegal. freopen should be used instead. |Admitted.. I havn't yet tried reopen'ing stdout/stderr :-) You misunderstand here. In current Ruby, assignment to $stdin etc. does reopen *at the time of assignment*. matz.