title: Get path to Swift script from within script
body: <p>I'm writing a script in Swift, and I want it to modify some files that always exist in the same directory as the script itself. Is there a way to get the path to the script from within itself? I tried:</p>
  
  <pre><code>print(Process.arguments)
  </code></pre>
  
  <p>But that outputs only the path that was actually given to the script, which may be the fully resolved path, just the file name, or anything in between.</p>
  
  <p>I'm intending the script to be run with <code>swift /path/to/my/script.swift</code>.</p>