impl new os_isdir to check dir exists