title: How to run a Process in Swift 3.0 with standard input
body: <p>I have a problem when run MySQL restore dump file with Swift Process.</p>
  <pre class="lang-swift prettyprint-override"><code>let command = &quot;/usr/local/bin/mysql -h theHost -P 3306 -u root -pTheInlinePassword example_database &lt; dumpFile.sql&quot;
  let task = Process()
  task.launchPath = &quot;/usr/bin/env&quot;
  task.arguments = command.components(separatedBy: &quot; &quot;)
  task.launch()
  </code></pre>
  <p>The problem is Process doesn't understand standard input <code>&lt;</code>. How I can run command with standard input like this? Thanks.</p>
  <p>Update:</p>
  <pre class="lang-swift prettyprint-override"><code>let task = Process()
  task.launchPath = &quot;/usr/local/bin/mysql&quot;
  task.arguments =  [&quot;-h&quot;, &quot;theHost&quot;, &quot;-P&quot;, &quot;3306&quot;, &quot;-u&quot;, &quot;root&quot;, &quot;-pTheInLinePassword&quot;, &quot;example_data&quot;]
  task.standardInput = try! FileHandle(forReadingFrom: filePath!)
  task.launch()
  </code></pre>
  <p>I tried code below. This works for me</p>