rename O_DIRECTORY to O_TMP_DIRECTORY to avoid conflict with open option