~ubuntu-branches/ubuntu/karmic/gnustep-base/karmic

« back to all changes in this revision

Viewing changes to Documentation/gsdoc/NSTask.html

  • Committer: Bazaar Package Importer
  • Author(s): Eric Heintzmann
  • Date: 2005-04-17 00:14:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050417001438-enf0y07c9tku85z1
Tags: 1.10.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html><head>
2
 
 <title>NSTask</title>
3
 
</head>
4
 
<body>
5
 
<a href ="NSString.html">[Previous] </a>
6
 
<a href ="Base.html">[Up] </a>
7
 
<a href ="NSThread.html">[Next] </a>
8
 
<h1>NSTask</h1>
9
 
<h3>Authors </h3>
10
 
 <dl>
11
 
<dt><a href ="http://www.gnustep.org/developers/whoiswho.html">Richard Frith-Macdonald</a>
12
 
<dd>
13
 
</dl>
14
 
<p>Version: $Revision: 1.14 $</p>
15
 
<p>Date: $Date: 2001/12/12 14:10:13 $</p>
16
 
<h2><a name ="cont-0">NSTask</a></h2>
17
 
<h2><a name ="NSTask">NSTask</a></h2>
18
 
<p><b>Declared in: </b> Foundation/NSTask.h</p>
19
 
<p><b>Inherits from: </b> NSObject</p>
20
 
<p><b>Conforms to: </b> NSObject
21
 
</p>
22
 
<hr>
23
 
 
24
 
            The NSTask class provides a mechanism to run separate tasks
25
 
            under (limited) control of your program.
26
 
          
27
 
<h2>Instance Variables </h2>
28
 
<ul>
29
 
</ul>
30
 
<h2>Methods </h2>
31
 
<ul>
32
 
<li ><a href ="NSTask.html#method-0">+launchedTaskWithLaunchPath:arguments:</a>
33
 
<li ><a href ="NSTask.html#method-1">-arguments</a>
34
 
<li ><a href ="NSTask.html#method-2">-currentDirectoryPath</a>
35
 
<li ><a href ="NSTask.html#method-3">-environment</a>
36
 
<li ><a href ="NSTask.html#method-4">-interrupt</a>
37
 
<li ><a href ="NSTask.html#method-5">-isRunning</a>
38
 
<li ><a href ="NSTask.html#method-6">-launch</a>
39
 
<li ><a href ="NSTask.html#method-7">-launchPath</a>
40
 
<li ><a href ="NSTask.html#method-8">-processIdentifer</a>
41
 
<li ><a href ="NSTask.html#method-19">-resume</a>
42
 
<li ><a href ="NSTask.html#method-9">-setArguments:</a>
43
 
<li ><a href ="NSTask.html#method-10">-setCurrentDirectoryPath:</a>
44
 
<li ><a href ="NSTask.html#method-11">-setEnvironment:</a>
45
 
<li ><a href ="NSTask.html#method-12">-setLaunchPath:</a>
46
 
<li ><a href ="NSTask.html#method-13">-setStandardError:</a>
47
 
<li ><a href ="NSTask.html#method-14">-setStandardInput:</a>
48
 
<li ><a href ="NSTask.html#method-15">-setStandardOutput:</a>
49
 
<li ><a href ="NSTask.html#method-16">-standardError</a>
50
 
<li ><a href ="NSTask.html#method-17">-standardInput</a>
51
 
<li ><a href ="NSTask.html#method-18">-standardOutput</a>
52
 
<li ><a href ="NSTask.html#method-20">-suspend</a>
53
 
<li ><a href ="NSTask.html#method-21">-terminate</a>
54
 
<li ><a href ="NSTask.html#method-22">-terminationStatus</a>
55
 
<li ><a href ="NSTask.html#method-23">-usePseudoTerminal</a>
56
 
<li ><a href ="NSTask.html#method-24">-waitUntilExit</a>
57
 
</ul>
58
 
<hr><h2>Class Methods </h2>
59
 
<h3><a name ="method-0">launchedTaskWithLaunchPath:arguments:</a></h3>
60
 
+ (NSTask*) <b>launchedTaskWithLaunchPath:</b> (NSString*)path <b>arguments:</b> (NSArray*)arguments;<br>
61
 
 
62
 
            Creates and launches a task, returning an autoreleased task object.
63
 
            Supplies the path to the executable and an array of argument.
64
 
            The task inherits the parents environment and I/O.
65
 
          
66
 
 <hr>
67
 
<hr><h2>Instances Methods </h2>
68
 
<h3><a name ="method-1">arguments</a></h3>
69
 
- (NSArray*) <b>arguments</b>;<br>
70
 
 
71
 
            Returns the arguments set for the task.
72
 
          
73
 
 <hr>
74
 
<h3><a name ="method-2">currentDirectoryPath</a></h3>
75
 
- (NSString*) <b>currentDirectoryPath</b>;<br>
76
 
 
77
 
            Returns the working directory set for the task.
78
 
          
79
 
 <hr>
80
 
<h3><a name ="method-3">environment</a></h3>
81
 
- (NSDictionary*) <b>environment</b>;<br>
82
 
 
83
 
            Returns the environment set for the task.
84
 
          
85
 
 <hr>
86
 
<h3><a name ="method-4">interrupt</a></h3>
87
 
- (void) <b>interrupt</b>;<br>
88
 
 
89
 
            Sends an interrupt signal to the receiver and any subtasks.<br>
90
 
            If the task has not been launched, raises an
91
 
            NSInvalidArgumentException.<br> 
92
 
            Has no effect on a task that has already terminated.<br>
93
 
            This is rather like the terminate method, but the child
94
 
            process may not choose to terminate in response to an interrupt.
95
 
          
96
 
 <hr>
97
 
<h3><a name ="method-5">isRunning</a></h3>
98
 
- (BOOL) <b>isRunning</b>;<br>
99
 
 
100
 
            Checks to see if the task is currently running.
101
 
          
102
 
 <hr>
103
 
<h3><a name ="method-6">launch</a></h3>
104
 
- (void) <b>launch</b>;<br>
105
 
 
106
 
            Launches the task.<br>
107
 
            Raises an NSInvalidArgumentException if the launch path is not
108
 
            set or if the subtask cannot be started for some reason
109
 
            (eg. the executable does not exist).
110
 
          
111
 
 <hr>
112
 
<h3><a name ="method-7">launchPath</a></h3>
113
 
- (NSString*) <b>launchPath</b>;<br>
114
 
 
115
 
            Returns the launch path set for the task.
116
 
          
117
 
 <hr>
118
 
<h3><a name ="method-8">processIdentifer</a></h3>
119
 
- (int) <b>processIdentifer</b>;<br>
120
 
 
121
 
            Returns the number identifying the child process on this system.
122
 
          
123
 
 <hr>
124
 
<h3><a name ="method-9">setArguments:</a></h3>
125
 
- (void) <b>setArguments:</b> (NSArray*)arguments;<br>
126
 
 
127
 
            Sets an array of arguments to be supplied to the task when it
128
 
            is launched.  The default is an empty array.  This method cannot
129
 
            be used after a task is launched ...
130
 
            it raises an NSInvalidArgumentException. 
131
 
          
132
 
 <hr>
133
 
<h3><a name ="method-10">setCurrentDirectoryPath:</a></h3>
134
 
- (void) <b>setCurrentDirectoryPath:</b> (NSString*)path;<br>
135
 
 
136
 
            Sets the home directory in which the task is to be run.
137
 
            The default is the parent processes directory. 
138
 
            This method cannot be used after a task is launched ...
139
 
            it raises an NSInvalidArgumentException. 
140
 
          
141
 
 <hr>
142
 
<h3><a name ="method-11">setEnvironment:</a></h3>
143
 
- (void) <b>setEnvironment:</b> (NSDictionary*)environmentDictionary;<br>
144
 
 
145
 
            Sets the environment variables for the task to be run.
146
 
            The default is the parent processes environment. 
147
 
            This method cannot be used after a task is launched ...
148
 
            it raises an NSInvalidArgumentException. 
149
 
          
150
 
 <hr>
151
 
<h3><a name ="method-12">setLaunchPath:</a></h3>
152
 
- (void) <b>setLaunchPath:</b> (NSString*)path;<br>
153
 
 
154
 
            Sets the path to the executable file to be run.
155
 
            There is no default for this - you must set the launch path.
156
 
            This method cannot be used after a task is launched ...
157
 
            it raises an NSInvalidArgumentException. 
158
 
          
159
 
 <hr>
160
 
<h3><a name ="method-13">setStandardError:</a></h3>
161
 
- (void) <b>setStandardError:</b> (id)file;<br>
162
 
 
163
 
            Sets the standard error stream for the task.<br>
164
 
            This is normally a writable NSFileHandle object.
165
 
            If this is an NSPipe, the write end of the pipe is
166
 
            automatically closed on launching.<br>
167
 
            The default behavior is to inherit the parent processes
168
 
            stderr output.<br>
169
 
            This method cannot be used after a task is launched ...
170
 
            it raises an NSInvalidArgumentException. 
171
 
          
172
 
 <hr>
173
 
<h3><a name ="method-14">setStandardInput:</a></h3>
174
 
- (void) <b>setStandardInput:</b> (id)file;<br>
175
 
 
176
 
            Sets the standard input stream for the task.<br>
177
 
            This is normally a readable NSFileHandle object.
178
 
            If this is an NSPipe, the read end of the pipe is
179
 
            automatically closed on launching.<br>
180
 
            The default behavior is to inherit the parent processes
181
 
            stdin stream.<br>
182
 
            This method cannot be used after a task is launched ...
183
 
            it raises an NSInvalidArgumentException. 
184
 
          
185
 
 <hr>
186
 
<h3><a name ="method-15">setStandardOutput:</a></h3>
187
 
- (void) <b>setStandardOutput:</b> (id)file;<br>
188
 
 
189
 
            Sets the standard output stream for the task.<br>
190
 
            This is normally a writable NSFileHandle object.
191
 
            If this is an NSPipe, the write end of the pipe is
192
 
            automatically closed on launching.<br>
193
 
            The default behavior is to inherit the parent processes
194
 
            stdout stream.<br>
195
 
            This method cannot be used after a task is launched ...
196
 
            it raises an NSInvalidArgumentException. 
197
 
          
198
 
 <hr>
199
 
<h3><a name ="method-16">standardError</a></h3>
200
 
- (id) <b>standardError</b>;<br>
201
 
 
202
 
            Returns the standard error stream for the task - an NSFileHandle
203
 
            unless an NSPipe was passed to setStandardError:
204
 
          
205
 
 <hr>
206
 
<h3><a name ="method-17">standardInput</a></h3>
207
 
- (id) <b>standardInput</b>;<br>
208
 
 
209
 
            Returns the standard input stream for the task - an NSFileHandle
210
 
            unless an NSPipe was passed to setStandardInput:
211
 
          
212
 
 <hr>
213
 
<h3><a name ="method-18">standardOutput</a></h3>
214
 
- (id) <b>standardOutput</b>;<br>
215
 
 
216
 
            Returns the standard output stream for the task - an NSFileHandle
217
 
            unless an NSPipe was passed to setStandardOutput:
218
 
          
219
 
 <hr>
220
 
<h3><a name ="method-19">resume</a></h3>
221
 
- (BOOL) <b>resume</b>;<br>
222
 
 
223
 
            Sends a cont signal to the receiver and any subtasks.<br>
224
 
            If the task has not been launched, raises an
225
 
            NSInvalidArgumentException.<br> 
226
 
          
227
 
 <hr>
228
 
<h3><a name ="method-20">suspend</a></h3>
229
 
- (BOOL) <b>suspend</b>;<br>
230
 
 
231
 
            Sends a stop signal to the receiver and any subtasks.<br>
232
 
            If the task has not been launched, raises an
233
 
            NSInvalidArgumentException.<br> 
234
 
          
235
 
 <hr>
236
 
<h3><a name ="method-21">terminate</a></h3>
237
 
- (void) <b>terminate</b>;<br>
238
 
 
239
 
            Sends a terminate signal to the receiver and any subtasks.<br>
240
 
            If the task has not been launched, raises an
241
 
            NSInvalidArgumentException.<br> 
242
 
            Has no effect on a task that has already terminated.<br>
243
 
            When a task temrinates, either due to this method being called,
244
 
            or normal termination, an NSTaskDidTerminateNotification is
245
 
            posted.
246
 
          
247
 
 <hr>
248
 
<h3><a name ="method-22">terminationStatus</a></h3>
249
 
- (int) <b>terminationStatus</b>;<br>
250
 
 
251
 
            Returns the termination status of the task.<br>
252
 
            If the task has not completed running, raises an
253
 
            NSInvalidArgumentException.
254
 
          
255
 
 <hr>
256
 
<h3><a name ="method-23">usePseudoTerminal</a></h3>
257
 
- (BOOL) <b>usePseudoTerminal</b>;<br>
258
 
Standards:  GNUstep NotMacOS-X NotOpenStep<br>
259
 
 
260
 
            If the system supports it, this method sets the standard
261
 
            input, output, and error streams to a pseudo-terminal so
262
 
            that, when launched, the child task will act as if it was
263
 
            running interactively on a terminal.  The file handles
264
 
            can then be used to communicate with the child.<br>
265
 
            This method cannot be used after a task is launched ...
266
 
            it raises an NSInvalidArgumentException.<br>
267
 
            The standard input, output and error streams cannot be
268
 
            changed after calling this method.<br>
269
 
            The method returns YES on success, NO on failure.
270
 
          
271
 
 <hr>
272
 
<h3><a name ="method-24">waitUntilExit</a></h3>
273
 
- (void) <b>waitUntilExit</b>;<br>
274
 
 
275
 
            Suspends the current thread until the task terminates, by
276
 
            waiting in NSRunLoop (NSDefaultRunLoopMode) for the task
277
 
            termination.<br>
278
 
            Returns immediately if the task is not running.
279
 
          
280
 
 <hr>
281
 
</body>
282
 
 
283
 
 </html>