avoid using samefile as it does not exist on Windows