On Sat, 10 May 2003 00:07:34 +0900, ts wrote:
> 
>  IO::new don't do what you want ?

Im trying out IO::new right now... But no data is going through the pipe?
 

	ruby_init();
	ruby_init_loadpath();
	ruby_options(argc, argv);

/*	FILE *fd = rb_fdopen(pipes[1], "w"); 
	int mode = FMODE_WRITABLE|FMODE_SYNC;
	VALUE klass = rb_cIO;
	VALUE w = prep_stdio(fd, mode, klass);*/

	VALUE params[2];
	params[0] = INT2FIX(pipes[1]);
	params[1] = rb_str_new2("w");
	VALUE klass = rb_path2class("IO"); 
	VALUE w = rb_class_new_instance(2, params, klass);

	rb_defout = rb_stdout = rb_stderr = w;   // Is this correct ???

	ruby_run();

> cat run.sh
../a.out -e 'puts "hello"; system("ls"); sleep 5'
>


How do I redirect stdout/stderr ?

--
Simon Strandgaard