realpath replaced with custom implementation which does not resolve symlinks