Package org.jruby.util.io
Class PopenExecutor
java.lang.Object
org.jruby.util.io.PopenExecutor
Port of MRI's popen+exec logic.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RubyString
checkArgv
(ThreadContext context, IRubyObject[] argv) static RubyArray
checkExecEnv
(ThreadContext context, RubyHash hash, PopenExecutor.ExecArg pathArg) static IRubyObject
checkPipeCommand
(ThreadContext context, IRubyObject filenameOrCommand) static PopenExecutor.ExecArg
execargNew
(ThreadContext context, IRubyObject[] argv, IRubyObject optForChdir, boolean accept_shell, boolean allow_exc_opt) static boolean
nativePopenAvailable
(Ruby runtime) Check properties and runtime state to determine whether a native popen is possible.static IRubyObject
pipeOpen
(ThreadContext context, IRubyObject prog, String modestr, int fmode, IOEncodable convconfig) static IRubyObject
popen
(ThreadContext context, IRubyObject[] argv, RubyClass klass, Block block) static RubyFixnum
spawn
(ThreadContext context, IRubyObject[] argv) systemInternal
(ThreadContext context, IRubyObject[] argv, String[] errmsg)
-
Field Details
-
SH_CHDIR_ARG_COUNT
public static final int SH_CHDIR_ARG_COUNT- See Also:
-
-
Constructor Details
-
PopenExecutor
public PopenExecutor()
-
-
Method Details
-
nativePopenAvailable
Check properties and runtime state to determine whether a native popen is possible.- Parameters:
runtime
- current runtime- Returns:
- true if popen can use native code, false otherwise
-
checkPipeCommand
-
spawn
-
systemInternal
-
pipeOpen
public static IRubyObject pipeOpen(ThreadContext context, IRubyObject prog, String modestr, int fmode, IOEncodable convconfig) -
popen
public static IRubyObject popen(ThreadContext context, IRubyObject[] argv, RubyClass klass, Block block) -
checkExecEnv
public static RubyArray checkExecEnv(ThreadContext context, RubyHash hash, PopenExecutor.ExecArg pathArg) -
execargNew
public static PopenExecutor.ExecArg execargNew(ThreadContext context, IRubyObject[] argv, IRubyObject optForChdir, boolean accept_shell, boolean allow_exc_opt) -
checkArgv
-