Monday, September 5, 2005 12:50 PM
public Process exec(String cmdarray, String envp, File dir);
* Executes the specified command and arguments in a separate process with
* the specified environment and working directory.
* If there is a security manager, its
* method is called with the first component of the array
cmdarray as its argument. This may result in a security
* Given an array of strings
cmdarray, representing the
* tokens of a command line, and an array of strings
* representing "environment" variable settings, this method creates
* a new process in which to execute the specified command.
* If envp is null, the subprocess inherits the
* environment settings of the current process.
* The working directory of the new subprocess is specified by dir.
* If dir is null, the subprocess inherits the
* current working directory of the current process.
* @param cmdarray array containing the command to call and
* its arguments.
* @param envp array of strings, each element of which
* has environment variable settings in format
* @param dir the working directory of the subprocess, or
* null if the subprocess should inherit
* the working directory of the current process.
* @return a
Process object for managing the subprocess.
* @exception SecurityException if a security manager exists and its
checkExec method doesn't allow creation of a
* @exception NullPointerException if
* @exception IndexOutOfBoundsException if
cmdarray is an
* empty array (has length
* @exception IOException if an I/O error occurs.
* @see java.lang.Process
* @see java.lang.SecurityException
* @see java.lang.SecurityManager#checkExec(java.lang.String)
* @since 1.3