get_remove_dir_fun function

Get a function that, from a filename, returns the part without the directory.