title: Swift and NSTask hangs
body: <p>i am new to the Mac World. I'm using Swift and i am trying to run external processes one at a time. 
  Now everything works fine, as long, as it is debugged, by which I mean: Run in Xcode with Debugger attached. </p>
  
  <p>I do not change anything and try to run it in the terminal window, from it's place in the "Debug" folder. Now the external process starts but hangs.There is some STDERR output, which I already switched off. And there is DiskIO by the external Task.</p>
  
  <pre><code>let video : NSTask = NSTask()
  video.launchPath = "./ffmpeg"
  video.arguments = ["-i", "\(item)", "-c:v","copy", "-bsf:v", "h264_mp4toannexb", "-an", "-y", "-loglevel", "quiet", "\(path).h264"]
  
  //also tried without the following two lines
  video.standardError = NSFileHandle.fileHandleWithStandardError()
  video.standardOutput = NSFileHandle.fileHandleWithStandardOutput()
  
  video.launch()
  video.waitUntilExit()
  </code></pre>
  
  <p>Yes: I copied everything to the current path, so that execution works. It starts but hangs when run from terminal.</p>
  
  <p>Now the Question arises: WHY?! What am I doing wrong here? The easy solution would be to always run it in Xcode, but as you might imagine, that is quite inconvenient with a command line tool.</p>