readlink doesn't exist on the mac, try this local function getfullpath