add a readlink function to core.lib