Changes filename to take arbitrary arities

However, when a . ~ or / is found the path will be truncated at that
location.