IO redirections and Kernel.exec

E

Eric Jacoboni

Hi,

In C, if i redirect, say stderr, to a file before doing an
exec(). The exec inheriting of the file descriptors, the command
exec'ed will produce its error messages in the file i've chosen.

I've tried to mimic this with Ruby using this snippet:

$stderr = File.open("erreur", File::WRONLY|File::CREAT, 0644)
exec("gcc -c bla.c")

but it seems that exec doesn't care of my redirection.

What i've missed?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top