Pathname's relative_path_from() will do the trick.