![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/doc/gnustep-base-doc/Base/Reference/ |
Upload File : |
<?xml version="1.0"?> <!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 1.0.4//EN" "http://www.gnustep.org/gsdoc-1_0_4.dtd"> <gsdoc base="NSTask" up="Base"> <head> <title>NSTask class reference</title> <author name="Richard Frith-Macdonald"> <email address="richard@brainstorm.co.uk"> richard@brainstorm.co.uk </email> </author> <copy>1998,1999 Free Software Foundation, Inc.</copy> </head> <body> <front><contents /></front> <chapter> <heading> Software documentation for the NSTask class </heading> <class name="NSTask" super="NSObject" ovadd="1.0.0"> <declared>Foundation/NSTask.h</declared> <desc> The NSTask class provides a mechanism to run separate tasks under (limited) control of your program. </desc> <ivariable type="NSArray*" name="_arguments" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <ivariable type="NSString*" name="_currentDirectoryPath" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <ivariable type="NSDictionary*" name="_environment" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <ivariable type="BOOL" name="_hasCollected" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <ivariable type="BOOL" name="_hasLaunched" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <ivariable type="BOOL" name="_hasNotified" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <ivariable type="BOOL" name="_hasTerminated" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <ivariable type="NSString*" name="_launchPath" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <ivariable type="NSThread*" name="_launchingThread" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <ivariable type="id" name="_standardError" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <ivariable type="id" name="_standardInput" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <ivariable type="id" name="_standardOutput" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <ivariable type="int" name="_taskId" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <ivariable type="NSTaskTerminationReason" name="_terminationReason" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <ivariable type="int" name="_terminationStatus" validity="protected" ovadd="1.0.0"> <desc> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code. </desc> </ivariable> <method type="NSTask*" factory="yes" ovadd="1.0.0"> <sel>launchedTaskWithLaunchPath:</sel> <arg type="NSString*">path</arg> <sel>arguments:</sel> <arg type="NSArray*">args</arg> <desc> Creates and launches a task, returning an autoreleased task object. Supplies the <var>path</var> to the executable and an array of argument. The task inherits the parents environment and I/O. </desc> </method> <method type="NSArray*" ovadd="1.0.0"> <sel>arguments</sel> <desc> Returns the arguments set for the task. </desc> </method> <method type="NSString*" ovadd="1.0.0"> <sel>currentDirectoryPath</sel> <desc> Returns the working directory set for the task. </desc> </method> <method type="NSDictionary*" ovadd="1.0.0"> <sel>environment</sel> <desc> Returns the environment set for the task. </desc> </method> <method type="void" ovadd="1.0.0"> <sel>interrupt</sel> <desc> 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. </desc> </method> <method type="BOOL" ovadd="1.0.0"> <sel>isRunning</sel> <desc> Checks to see if the task is currently running. </desc> </method> <method type="void" ovadd="1.0.0"> <sel>launch</sel> <desc> 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 or the task has already been launched). The actual launching is done in a concrete subclass; this method just takes care of actions common to all subclasses. </desc> </method> <method type="NSString*" ovadd="1.0.0"> <sel>launchPath</sel> <desc> Returns the launch path set for the task. </desc> </method> <method type="int" ovadd="10.0.0"> <sel>processIdentifier</sel> <desc> Returns the number identifying the child process on this system. </desc> </method> <method type="BOOL" ovadd="10.0.0"> <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="void" ovadd="1.0.0"> <sel>setArguments:</sel> <arg type="NSArray*">args</arg> <desc> 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. </desc> </method> <method type="void" ovadd="1.0.0"> <sel>setCurrentDirectoryPath:</sel> <arg type="NSString*">path</arg> <desc> 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. </desc> </method> <method type="void" ovadd="1.0.0"> <sel>setEnvironment:</sel> <arg type="NSDictionary*">env</arg> <desc> 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. </desc> </method> <method type="void" ovadd="1.0.0"> <sel>setLaunchPath:</sel> <arg type="NSString*">path</arg> <desc> Sets the <var>path</var> to the executable file to be run. There is no default for this - you must set the launch <var>path</var>. This method cannot be used after a task is launched... it raises an NSInvalidArgumentException. </desc> </method> <method type="void" ovadd="1.0.0"> <sel>setStandardError:</sel> <arg type="id">hdl</arg> <desc> 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. </desc> </method> <method type="void" ovadd="1.0.0"> <sel>setStandardInput:</sel> <arg type="id">hdl</arg> <desc> 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. </desc> </method> <method type="void" ovadd="1.0.0"> <sel>setStandardOutput:</sel> <arg type="id">hdl</arg> <desc> 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. </desc> </method> <method type="id" ovadd="1.0.0"> <sel>standardError</sel> <desc> Returns the standard error stream for the task - an NSFileHandle unless an NSPipe was passed to <ref type="method" id="-setStandardError:"> -setStandardError: </ref> </desc> </method> <method type="id" ovadd="1.0.0"> <sel>standardInput</sel> <desc> Returns the standard input stream for the task - an NSFileHandle unless an NSPipe was passed to <ref type="method" id="-setStandardInput:"> -setStandardInput: </ref> </desc> </method> <method type="id" ovadd="1.0.0"> <sel>standardOutput</sel> <desc> Returns the standard output stream for the task - an NSFileHandle unless an NSPipe was passed to <ref type="method" id="-setStandardOutput:"> -setStandardOutput: </ref> </desc> </method> <method type="BOOL" ovadd="10.0.0"> <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> <method type="void" ovadd="1.0.0"> <sel>terminate</sel> <desc> Sends a terminate signal to the receiver and any subtasks. <br /> If the task has not been launched, raises an <code>NSInvalidArgumentException</code>. <br /> Has no effect on a task that has already terminated. <br /> When a task terminates, either due to this method being called, or normal termination, an <code>NSTaskDidTerminateNotification</code> is posted. </desc> </method> <method type="NSTaskTerminationReason" ovadd="10.5.0"> <sel>terminationReason</sel> <desc> Returns the termination reason of the task. <br /> If the task has not completed running, raises an NSInvalidArgumentException. </desc> </method> <method type="int" ovadd="1.0.0"> <sel>terminationStatus</sel> <desc> Returns the termination status of the task. <br /> If the task has not completed running, raises an NSInvalidArgumentException. </desc> </method> <method type="BOOL" ovadd="0.0.0" ovrem="0.0.0"> <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 <code>YES</code> on success, <code>NO</code> on failure. </desc> </method> <method type="NSString*" ovadd="0.0.0" ovrem="0.0.0"> <sel>validatedLaunchPath</sel> <desc> Returns a validated launch path or <code>nil</code> . <br /> Allows for the GNUstep host/operating system, and library combination subdirectories in a path, appending them as necessary to try to locate the actual binary to be used. <br /> Checks that the binary file exists and is executable. <br /> Even tries searching the directories in the PATH environment variable to locate a binary if the original launch path set was not absolute. </desc> </method> <method type="void" ovadd="1.0.0"> <sel>waitUntilExit</sel> <desc> 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. </desc> </method> </class> </chapter> </body> </gsdoc>