If I'm using opendir+readdir to traverse the filesystem -- how can I tell whether or not the files provided by readdir are directories and not additional files?
DIR* dir = ...
...
struct dirent* direntry = readdir( dir );
struct stat entrystat;
if (stat( direntry->d_name, &entrystat )) fooey();
if (S_ISDIR( entrystat.st_mode ))
{
// entry is a directory
}
...