if (stat(directory_path, &file_status) != 0 || /* cannot stat file */
(file_status.st_mode & S_IFMT) != S_IFDIR) /* not a directory */
{
if (stat(directory_path, &file_status) != 0 || /* cannot stat file */
(file_status.st_mode & S_IFMT) != S_IFDIR) /* not a directory */
{