I think you can use `realpath()` instead of calling an external program.