title: Path to a file without basename
body: <p>How can I get the path of a file without the file basename?</p>
  <p>Something like <code>/a/path/to/my/file.txt</code> --&gt; <code>/a/path/to/my/</code></p>
  <p>Tried with <code>.split()</code> without success.</p>