How to use S_ISREG() and S_ISDIR() POSIX Macros?
This is a C program I wrote to recursively navigate and output directories and regular files. It compiles and runs fine on my Linux machine. But on Solaris, the dit->d_type == 8 check and the other similar ones don't work because there is no d_type field. An answer I've read to this problem is to use the S_ISREG() and S_ISDIR() macros, but they don't work at all the way I have them in my code currently. I commented out the lines that work on my Linux machine. #include <sys/types.h> #include <sys/stat.h> #include <stdlib.h> #include <dirent.h> #include <stdio.h> #include <unistd.h> #include