//static int so_select (const struct dirent *dire)
/* struct dirent { ino_t d_ino; // inode number off_t d_off; // offset to the next dirent unsigned short d_reclen; // length of this record unsigned char d_type; // type of file char d_name[256]; //filename };
According to POSIX, the dirent structure contains a field char d_name[] of unspecified size, with at most NAME_MAX characters preceding the terminating null byte
while (fgets(buf, MAXLINE, file) != NULL) { //get one line in buf everytime. char * bp = buf; /* Skip over white space */ bp += strspn(bp, WHITESPACE);
/* Zap comments on the line */ if ((cp = strchr(bp, COMMENTCHAR)) != NULL) { *cp = EOS; }