title: How do I get a file's parent directory?
body: <p>Given a path to a file, <code>c:\xxx\abc\xyz\fileName.jpg</code>, how can I get the file's parent folder? In this example, I'm looking for <code>xyz</code>. The number of directories to get to the file may vary.</p>