title: sys/stat S_ISDIR(m) with struct dirent
body: <p>I want to check to see if a file is a directory, link, or just a regular file. I loop through the directory and save each file as <code>struct dirent *</code>. I try to pass <code>d_ino</code> to <code>S_ISDIR(m)</code>, <code>S_ISLINK(m)</code>, or <code>S_ISREG(m)</code> and regardless of the file, I will not get a positive result. So my question is: how do I use <code>S_ISDIR(m)</code> with <code>struct dirent</code>?</p>