Changes between Version 16 and Version 17 of ChapterChildProcesses
- Timestamp:
- 12/28/07 22:17:02 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ChapterChildProcesses
v16 v17 143 143 ||Error||{{{errno}}} value of the failure if the process was running; -1 if not||The wait on the child process failed|| 144 144 145 In order to simplify error handling there is also a convenience method called {{{Process.Result.to Utf8()}}} that will convert the process result into a human-readable message.145 In order to simplify error handling there is also a convenience method called {{{Process.Result.toString()}}} that will convert the process result into a human-readable message. 146 146 [[BR]] 147 147 200 200 Process p = new Process(command, env); 201 201 202 Stdout.formatln("Executing {}", p.to Utf8);202 Stdout.formatln("Executing {}", p.toString); 203 203 p.execute(); 204 204 215 215 Process.Result result = p.wait(); 216 216 217 Stdout.formatln("Process '{}' (pid {}) finished: {}", p.programName, p.pid, result.to Utf8);217 Stdout.formatln("Process '{}' (pid {}) finished: {}", p.programName, p.pid, result.toString); 218 218 } 219 219 catch (ProcessException e) 220 220 { 221 Stderr("Process execution failed: ") (e.to Utf8).newline;221 Stderr("Process execution failed: ") (e.toString).newline; 222 222 } 223 223 catch (IOException e) 224 224 { 225 Stderr("Input/output exception caught: ")(e.to Utf8).newline;225 Stderr("Input/output exception caught: ")(e.toString).newline; 226 226 } 227 227 catch (Exception e) 228 228 { 229 Stderr("Unexpected exception caught: ")(e.to Utf8).newline;229 Stderr("Unexpected exception caught: ")(e.toString).newline; 230 230 } 231 231 }