This isn't just using realpath to dodge symlinks, this is changing the directory name. Is that necessary?