dfs_search_file
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <string.h>
int dfs_search_file (const char *dir)
{
DIR *dp;
struct dirent *ep;
struct stat statbuf;
dp = opendir (dir);
if (dp != NULL)
{
while ((ep = readdir (dp))!=NULL)
{
if(ep->d_type==4)
{//is dir
if (strcmp(ep->d_name , ".")==0 || strcmp(ep->d_name , "..")==0)
//if (ep->d_name[strlen(ep->d_name)-1]=='.')
{
continue;
}
//
char * tmp = (char *)malloc(sizeof(char) * (strlen(ep->d_name) + strlen(dir)+2 ));
strcpy(tmp,dir);
strcat(tmp,"/");
strcat(tmp,ep->d_name);
/