Class LnxPty

java.lang.Object
javaforce.jni.lnx.LnxPty

public class LnxPty extends Object
  • Constructor Details

    • LnxPty

      public LnxPty()
  • Method Details

    • init

      public static boolean init()
    • exec

      public static LnxPty exec(String cmd, String[] args, String[] env)
      Spawns cmd with args and env (both must be null terminated arrays) and returns new pty.
    • execOutput

      public static String execOutput(String cmd, String[] args, String[] env)
      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

      public static void main(String[] args)
      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

      public static String[] makeEnvironment(String[] extra)
      Returns current processes environment variables plus those passed in extra. extra overrides current variables.
    • makeEnvironment

      public static String[] makeEnvironment()