Peter Hosey committed 73bba9a


  • Participants
  • Parent commits c5a8640

Comments (0)

Files changed (1)

-== Welcome ==
+== What it is ==
-Welcome to your wiki! This is the default page we've installed for your convenience. Go ahead and edit it.
+A replacement for NSTask. Should be drop-in for most (eventually all) purposes.
-=== Wiki features ===
+If there's anything in NSTask that this doesn't implement that you need, please file a request in the issue tracker. If you implement it yourself, please send in a patch.
-This wiki uses the [[|Creole]] syntax, and is fully compatible with the 1.0 specification.
+== Features ==
-The wiki itself is actually a mercurial repository, which means you can clone it, edit it locally/offline, add images or any other file type, and push it back to us. It will be live immediately.
+* Output accumulation: The task can (optionally) read data from stdout and stderr for you. You collect it as either raw data or a string (decoded from UTF-8) when the process is done.
+* Completion blocks: You can set a block to be called when the task successfully terminates or when it abnormally terminates. You can set a different block on each or the same block on both.
+* Whitespace chomping: When using output accumulation, if you ask for the output as a string, it will, by default, come with any whitespace trimmed off the start and end. (You can turn this off.)
+* Easily set stdin, stdout, or stderr to /dev/null.
+* Formal properties for all properties.
+* Conveniences such as {{{currentDirectoryURL}}}, {{{argumentsIncludingProgramName}}}, and {{{taskWithProgramName:arguments:}}}.
-Go ahead and try:
+== Example ==
-$ hg clone
+[[|See the test program.]]
-Wiki pages are normal files, with the .wiki extension. You can edit them locally, as well as creating new ones.
+== Missing features ==
-=== Syntax highlighting ===
+Some of NSTask's features aren't implemented yet. (You can help!) These include:
-You can also highlight snippets of text, we use the excellent [[|Pygments]] library.
+* {{{standardInput}}}: You can nullify it, but can't hook it up to a pipe or FD yet.
+* {{{launchedTaskWithLaunchPath:arguments:}}}: It's just not very useful, so I didn't bother.
+* {{{suspend}}} and {{{resume}}}
+* {{{terminationReason}}} (the “did it exit or get killed?” method, not to be confused with {{{terminationStatus}}}, which is supported)
-Here's an example of some Python code:
+Features that will never be implemented include:
-def wiki_rocks(text):
-    formatter = lambda t: "funky"+t
-    return formatter(text)
-You can check out the source of this page to see how that's done, and make sure to bookmark [[|the vast library of Pygment lexers]], we accept the 'short name' or the 'mimetype' of anything in there.
-Have fun!
+* {{{NSTaskDidTerminateNotification}}} (blocks are better)
+* {{{waitUntilExit}}} (always makes a program worse; the termination blocks are a better solution)