public static IRubyObject pipeOpen(ThreadContext context, IRubyObject prog, String modestr, int fmode, IOEncodable convconfig) { IRubyObject[] argv = {prog}; ExecArg execArg = null; if (!isPopenFork(context.runtime, (RubyString)prog)) execArg = execargNew(context, argv, true); return new PopenExecutor().pipeOpen(context, execArg, modestr, fmode, convconfig); }
public static IRubyObject pipeOpen(ThreadContext context, IRubyObject prog, String modestr, int fmode, IOEncodable convconfig) { IRubyObject[] argv = {prog}; ExecArg execArg = null; if (!isPopenFork(context.runtime, (RubyString)prog)) execArg = execargNew(context, argv, true); return new PopenExecutor().pipeOpen(context, execArg, modestr, fmode, convconfig); }
public static RubyFixnum spawn(ThreadContext context, IRubyObject[] argv) { Ruby runtime = context.runtime; long pid = 0; String[] errmsg = { null }; ExecArg eargp; IRubyObject fail_str; eargp = execargNew(context, argv, true); execargFixup(context, runtime, eargp); fail_str = eargp.use_shell ? eargp.command_name : eargp.command_name; PopenExecutor executor = new PopenExecutor(); pid = executor.spawnProcess(context, runtime, eargp, errmsg); if (pid == -1) { if (errmsg[0] == null) { throw runtime.newErrnoFromErrno(executor.errno, fail_str.toString()); } throw runtime.newErrnoFromErrno(executor.errno, errmsg[0]); } return runtime.newFixnum(pid); }
public static RubyFixnum spawn(ThreadContext context, IRubyObject[] argv) { Ruby runtime = context.runtime; long pid = 0; String[] errmsg = { null }; ExecArg eargp; IRubyObject fail_str; eargp = execargNew(context, argv, true); execargFixup(context, runtime, eargp); fail_str = eargp.use_shell ? eargp.command_name : eargp.command_name; PopenExecutor executor = new PopenExecutor(); pid = executor.spawnProcess(context, runtime, eargp, errmsg); if (pid == -1) { if (errmsg[0] == null) { throw runtime.newErrnoFromErrno(executor.errno, fail_str.toString()); } throw runtime.newErrnoFromErrno(executor.errno, errmsg[0]); } return runtime.newFixnum(pid); }
PopenExecutor executor = new PopenExecutor(); pid = executor.spawnInternal(context, args, null);
PopenExecutor executor = new PopenExecutor(); pid = executor.spawnInternal(context, args, null);
modestr = OpenFile.ioOflagsModestr(runtime, oflags_p[0]); port = new PopenExecutor().pipeOpen(context, eargp, modestr, fmode_p[0], convconfig);
modestr = OpenFile.ioOflagsModestr(runtime, oflags_p[0]); port = new PopenExecutor().pipeOpen(context, eargp, modestr, fmode_p[0], convconfig);