write function for determining absolute path instead of relying on readlink.

Only because readlink is broken on older versions of OS X