Show only some contents of a folder in a client/server in C
问题 I'm developing a client/server program in C where I want to see the file contents in a folder. The program works, but I would to see only a .txt file, not all the files. How can I do this? Thank you! DIR *dp; int rv,rv1,stop_received,nread2; struct dirent *ep; char buffer[300],appoggio[1000],buffer2[300]; dp = opendir ("./"); if (dp != NULL){ while (ep = readdir(dp)){ if ((strcmp(ep->d_name, ".") == 0) || (strcmp(ep->d_name,"..") == 0) || (strcmp(ep->d_name, "SERVERD.c\0") == 0) ||(strcmp(ep-