Returns a string suitable to be displayed in the UI indicating the name of the directory where the file is located.
For remote files it may also contain the hostname etc. For local files it tries to replace the home dir with ~.
location |
the location |
a string to display the dirname |