Eliminate readlink entirely and do the same thing on all platforms