int isDir(char *pathName) { #ifdef DEBUG printf("isDir(%s)\n", pathName); fflush(NULL); #endif struct stat s; if(stat(pathName, &s) == -1) { printf("Cannot stat %s\n", pathName); return FALSE; // not fatal } if(s.st_mode == S_IFDIR) return TRUE; else return FALSE; }