Use clink API instead of a hack to check directory existence