Bob Calco wrote: > Hi all: > > I'd like to embed Ruby in an agent/service program that keeps running, but > I'm wondering if it isn't easier to just create a process and redirect the > output rather than embed the interpreter. I've looked at main.c for an > example, and at eruby, but neither are quite analogous to what I'd like to > do. It's explained in the book "Ruby Developers Guide" which will ship this month. All you have to do is to initialize Ruby once with (don't forget to #include "ruby.h"): ruby_init(); ruby_init_loadpath(); Then you can use the rb_XXX methods to create objects etc. For example you can read in a Ruby source file with: rb_require("./file.rb"); And then call a method with rb_funcall2(VALUE obj, ID method, int nr_params, VALUE* params) or rb_eval_string(char* str) There are lots of further functions. Also have a look at file README.EXT of the Ruby distribution. Regards, Michael -- Michael Neumann merlin.zwo InfoDesign GmbH http://www.merlin-zwo.de