i have the follwing code to list the files in a directory.........but i need the name of the files which doesnt have any extensions
for e.g.
if my directory containts the following files:
a
gg
1.txt
code.c
i need only "a" and "gg"
this is "C" in linux
Code:
chdir(dir);
while((entry = readdir(dp)) != NULL) {
lstat(entry->d_name,&statbuf);
if(S_ISDIR(statbuf.st_mode)) {
if(strcmp(".",entry->d_name) == 0 ||
strcmp("..",entry->d_name) == 0)
continue;
printf("%*s%s/\n",depth,"",entry->d_name);
printdir(entry->d_name,depth+4);
}
else
printf("%s\n",entry->d_name);
thanx