On Thu, Sep 3, 2009 at 4:24 AM, Daniel Hahn<[email protected]> wrote:
> Hello,
>
> I'm trying to use the "backgroundjob" rails thingy with jruby (which uses a
> "systemu" library to #exec scripts). However, there's some unexpected
> bahaviour and I'd like to know what's going on behind the scenes...
>
> At the moment, my problem is mainly this:
>
> STDOUT.reopen('some.file')
> exec 'jruby some_script_with_output'
>
> if the script is a standard bash script, it will have it's stdout written to
> 'some.file'. If it's a jruby script, it will go to the real stdout (or
> nowhere at all). I wonder why this is - is the the jruby instance reused, or
> used in the same VM and messed up the original one? If so, is there a clean
> way to "exec" jruby code? I'd have expected that the exec call would
> substitute the whole system, VM and all (but then, how will the STDOUT
> handle be passed on).
>
> Maybe someone can shed some light on the internals?

We aren't able to implement #exec as you would expect right now --
#exec performs more or less the same as #system under JRuby. It's
possible we might be able to get it working using FFI in the future,
but for now this is the reason for the deviation in behavior you're
seeing.

/Nick

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to