Package javaforce.jni.lnx
Class LnxPty
java.lang.Object
javaforce.jni.lnx.LnxPty
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Frees resourcesstatic LnxPtySpawns cmd with args and env (both must be null terminated arrays) and returns new pty.static StringexecOutput(String cmd, String[] args, String[] env) Spawns cmd with args and env (both must be null terminated arrays).static booleaninit()booleanisClosed()static voidThis is the child process for fork() implementation.static String[]static String[]makeEnvironment(String[] extra) Returns current processes environment variables plus those passed in extra.intread(byte[] buf) Reads from child process (max 1024 bytes)voidsetSize(int x, int y) Sets the size of the ptyvoidwrite(byte[] buf) Writes to child process (max 1024 bytes)
-
Constructor Details
-
LnxPty
public LnxPty()
-
-
Method Details
-
init
public static boolean init() -
exec
Spawns cmd with args and env (both must be null terminated arrays) and returns new pty. -
execOutput
Spawns cmd with args and env (both must be null terminated arrays). Captures all output (stdout and stderr) and returns it. Does not return until child process exits. -
isClosed
public boolean isClosed() -
main
This is the child process for fork() implementation. -
close
public void close()Frees resources -
write
public void write(byte[] buf) Writes to child process (max 1024 bytes) -
read
public int read(byte[] buf) Reads from child process (max 1024 bytes) -
setSize
public void setSize(int x, int y) Sets the size of the pty -
makeEnvironment
Returns current processes environment variables plus those passed in extra. extra overrides current variables. -
makeEnvironment
-