2000-02-28 16:30:00 +00:00
|
|
|
<?xml version="1.0"?>
|
2000-07-04 19:53:39 +00:00
|
|
|
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.6//EN" "http://www.gnustep.org/gsdoc-0_6_6.xml">
|
|
|
|
<gsdoc base="NSTask" prev="NSString" next="NSThread" up="Base">
|
2000-02-28 16:30:00 +00:00
|
|
|
<head>
|
|
|
|
<title>NSTask</title>
|
|
|
|
<author name="Richard Frith-Macdonald">
|
|
|
|
<email address="rfm@gnu.org"/>
|
|
|
|
<url url="http://www.gnustep.org/developers/whoiswho.html"/>
|
|
|
|
</author>
|
2001-03-03 09:58:53 +00:00
|
|
|
<version>$Revision$</version>
|
2001-03-03 09:56:29 +00:00
|
|
|
<date>$Date$</date>
|
2000-02-28 16:30:00 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<chapter>
|
|
|
|
<heading>NSTask</heading>
|
|
|
|
<class name="NSTask" super="NSObject">
|
|
|
|
<declared>Foundation/NSTask.h</declared>
|
|
|
|
<conform>NSObject</conform>
|
2000-02-29 11:01:41 +00:00
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
The NSTask class provides a mechanism to run separate tasks
|
|
|
|
under (limited) control of your program.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="NSTask*" factory="yes">
|
|
|
|
<sel>launchedTaskWithLaunchPath:</sel>
|
|
|
|
<arg type="NSString*">path</arg>
|
|
|
|
<sel>arguments:</sel>
|
|
|
|
<arg type="NSArray*">arguments</arg>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Creates and launches a task, returning an autoreleased task object.
|
|
|
|
Supplies the path to the executable and an array of argument.
|
|
|
|
The task inherits the parents environment and I/O.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="NSArray*">
|
|
|
|
<sel>arguments</sel>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Returns the arguments set for the task.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="NSString*">
|
|
|
|
<sel>currentDirectoryPath</sel>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Returns the working directory set for the task.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="NSDictionary*">
|
|
|
|
<sel>environment</sel>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Returns the environment set for the task.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>interrupt</sel>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Sends an interrupt signal to the receiver and any subtasks.<br />
|
|
|
|
If the task has not been launched, raises an
|
|
|
|
NSInvalidArgumentException.<br />
|
|
|
|
Has no effect on a task that has already terminated.<br />
|
|
|
|
This is rather like the terminate method, but the child
|
|
|
|
process may not choose to terminate in response to an interrupt.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="BOOL">
|
|
|
|
<sel>isRunning</sel>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Checks to see if the task is currently running.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>launch</sel>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Launches the task.<br />
|
|
|
|
Raises an NSInvalidArgumentException if the launch path is not
|
|
|
|
set or if the subtask cannot be started for some reason
|
|
|
|
(eg. the executable does not exist).
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="NSString*">
|
|
|
|
<sel>launchPath</sel>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Returns the launch path set for the task.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2001-07-16 19:39:21 +00:00
|
|
|
<method type="int">
|
|
|
|
<sel>processIdentifer</sel>
|
|
|
|
<desc>
|
|
|
|
Returns the number identifying the child process on this system.
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>setArguments:</sel>
|
|
|
|
<arg type="NSArray*">arguments</arg>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Sets an array of arguments to be supplied to the task when it
|
|
|
|
is launched. The default is an empty array. This method cannot
|
|
|
|
be used after a task is launched ...
|
|
|
|
it raises an NSInvalidArgumentException.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>setCurrentDirectoryPath:</sel>
|
|
|
|
<arg type="NSString*">path</arg>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Sets the home directory in which the task is to be run.
|
|
|
|
The default is the parent processes directory.
|
|
|
|
This method cannot be used after a task is launched ...
|
|
|
|
it raises an NSInvalidArgumentException.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>setEnvironment:</sel>
|
|
|
|
<arg type="NSDictionary*">environmentDictionary</arg>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Sets the environment variables for the task to be run.
|
|
|
|
The default is the parent processes environment.
|
|
|
|
This method cannot be used after a task is launched ...
|
|
|
|
it raises an NSInvalidArgumentException.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>setLaunchPath:</sel>
|
|
|
|
<arg type="NSString*">path</arg>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Sets the path to the executable file to be run.
|
|
|
|
There is no default for this - you must set the launch path.
|
|
|
|
This method cannot be used after a task is launched ...
|
|
|
|
it raises an NSInvalidArgumentException.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>setStandardError:</sel>
|
|
|
|
<arg type="id">file</arg>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Sets the standard error stream for the task.<br />
|
|
|
|
This is normally a writable NSFileHandle object.
|
|
|
|
If this is an NSPipe, the write end of the pipe is
|
|
|
|
automatically closed on launching.<br />
|
|
|
|
The default behavior is to inherit the parent processes
|
|
|
|
stderr output.<br />
|
|
|
|
This method cannot be used after a task is launched ...
|
|
|
|
it raises an NSInvalidArgumentException.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>setStandardInput:</sel>
|
|
|
|
<arg type="id">file</arg>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Sets the standard input stream for the task.<br />
|
|
|
|
This is normally a readable NSFileHandle object.
|
|
|
|
If this is an NSPipe, the read end of the pipe is
|
|
|
|
automatically closed on launching.<br />
|
|
|
|
The default behavior is to inherit the parent processes
|
|
|
|
stdin stream.<br />
|
|
|
|
This method cannot be used after a task is launched ...
|
|
|
|
it raises an NSInvalidArgumentException.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>setStandardOutput:</sel>
|
|
|
|
<arg type="id">file</arg>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Sets the standard output stream for the task.<br />
|
|
|
|
This is normally a writable NSFileHandle object.
|
|
|
|
If this is an NSPipe, the write end of the pipe is
|
|
|
|
automatically closed on launching.<br />
|
|
|
|
The default behavior is to inherit the parent processes
|
|
|
|
stdout stream.<br />
|
|
|
|
This method cannot be used after a task is launched ...
|
|
|
|
it raises an NSInvalidArgumentException.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="id">
|
|
|
|
<sel>standardError</sel>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Returns the standard error stream for the task - an NSFileHandle
|
|
|
|
unless an NSPipe was passed to setStandardError:
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="id">
|
|
|
|
<sel>standardInput</sel>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Returns the standard input stream for the task - an NSFileHandle
|
|
|
|
unless an NSPipe was passed to setStandardInput:
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="id">
|
|
|
|
<sel>standardOutput</sel>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Returns the standard output stream for the task - an NSFileHandle
|
|
|
|
unless an NSPipe was passed to setStandardOutput:
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2001-07-16 19:39:21 +00:00
|
|
|
<method type="BOOL">
|
|
|
|
<sel>resume</sel>
|
|
|
|
<desc>
|
|
|
|
Sends a cont signal to the receiver and any subtasks.<br />
|
|
|
|
If the task has not been launched, raises an
|
|
|
|
NSInvalidArgumentException.<br />
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method type="BOOL">
|
|
|
|
<sel>suspend</sel>
|
|
|
|
<desc>
|
|
|
|
Sends a stop signal to the receiver and any subtasks.<br />
|
|
|
|
If the task has not been launched, raises an
|
|
|
|
NSInvalidArgumentException.<br />
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>terminate</sel>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Sends a terminate signal to the receiver and any subtasks.<br />
|
|
|
|
If the task has not been launched, raises an
|
|
|
|
NSInvalidArgumentException.<br />
|
|
|
|
Has no effect on a task that has already terminated.<br />
|
|
|
|
When a task temrinates, either due to this method being called,
|
|
|
|
or normal termination, an NSTaskDidTerminateNotification is
|
|
|
|
posted.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="int">
|
|
|
|
<sel>terminationStatus</sel>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Returns the termination status of the task.<br />
|
|
|
|
If the task has not completed running, raises an
|
|
|
|
NSInvalidArgumentException.
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method type="BOOL">
|
|
|
|
<sel>usePseudoTerminal</sel>
|
|
|
|
<desc>
|
|
|
|
If the system supports it, this method sets the standard
|
|
|
|
input, output, and error streams to a pseudo-terminal so
|
|
|
|
that, when launched, the child task will act as if it was
|
|
|
|
running interactively on a terminal. The file handles
|
|
|
|
can then be used to communicate with the child.<br />
|
|
|
|
This method cannot be used after a task is launched ...
|
|
|
|
it raises an NSInvalidArgumentException.<br />
|
|
|
|
The standard input, output and error streams cannot be
|
|
|
|
changed after calling this method.<br />
|
|
|
|
The method returns YES on success, NO on failure.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
<standards><GNUstep/><NotMacOS-X/><NotOpenStep/></standards>
|
2000-02-29 11:01:41 +00:00
|
|
|
</method>
|
2001-04-19 09:19:48 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>waitUntilExit</sel>
|
|
|
|
<desc>
|
2001-04-19 09:19:48 +00:00
|
|
|
Suspends the current thread until the task terminates, by
|
|
|
|
waiting in NSRunLoop (NSDefaultRunLoopMode) for the task
|
|
|
|
termination.<br />
|
|
|
|
Returns immediately if the task is not running.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
2000-02-28 18:30:41 +00:00
|
|
|
</method>
|
2000-02-28 16:30:00 +00:00
|
|
|
</class>
|
|
|
|
</chapter>
|
|
|
|
</body>
|
|
|
|
</gsdoc>
|