com.googlecode.android_scripting
Class Exec

java.lang.Object
  extended by com.googlecode.android_scripting.Exec

public class Exec
extends java.lang.Object

Tools for executing commands.


Constructor Summary
Exec()
           
 
Method Summary
static java.io.FileDescriptor createSubprocess(java.lang.String command, java.lang.String[] arguments, java.lang.String[] environmentVariables, java.lang.String workingDirectory)
           
static java.io.FileDescriptor createSubprocess(java.lang.String command, java.lang.String[] arguments, java.lang.String[] environmentVariables, java.lang.String workingDirectory, int[] processId)
           
static void setPtyWindowSize(java.io.FileDescriptor fd, int row, int col, int xpixel, int ypixel)
           
static int waitFor(int processId)
          Causes the calling thread to wait for the process associated with the receiver to finish executing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Exec

public Exec()
Method Detail

createSubprocess

public static java.io.FileDescriptor createSubprocess(java.lang.String command,
                                                      java.lang.String[] arguments,
                                                      java.lang.String[] environmentVariables,
                                                      java.lang.String workingDirectory)
Parameters:
cmd - The command to execute
arg0 - The first argument to the command, may be null
arg1 - the second argument to the command, may be null
Returns:
the file descriptor of the started process.

createSubprocess

public static java.io.FileDescriptor createSubprocess(java.lang.String command,
                                                      java.lang.String[] arguments,
                                                      java.lang.String[] environmentVariables,
                                                      java.lang.String workingDirectory,
                                                      int[] processId)
Parameters:
cmd - The command to execute
arguments - Array of arguments, may be null
environmentVariables - Array of environment variables, may be null
processId - A one-element array to which the process ID of the started process will be written.
Returns:
the file descriptor of the opened process's psuedo-terminal.

setPtyWindowSize

public static void setPtyWindowSize(java.io.FileDescriptor fd,
                                    int row,
                                    int col,
                                    int xpixel,
                                    int ypixel)

waitFor

public static int waitFor(int processId)
Causes the calling thread to wait for the process associated with the receiver to finish executing.

Returns:
The exit value of the Process being waited on