Hello hackers,
You don't need to call stat() just to find out if a dirent is a fileor directory, most of the time. Please see attached.