#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <io.h>
#include <dos.h>
int directorio(char *dir,char *match)
{
char fullfilename[128];
// struct find_t fileinfo;
struct _finddata_t fileinfo;
int count=0;
long hFile;
sprintf(fullfilename,"%s/%s",dir,match);
// if(_dos_findfirst(fullfilename,_A_NORMAL,&fileinfo))
if((hFile=_findfirst(fullfilename,&fileinfo))==-1)
{
return(0);
}
do
{
// if(file_match(fileinfo.name,match)!=-1)
// {
puts(fileinfo.name);
count++;
// }
}
// while(!_dos_findnext(&fileinfo));
while(!_findnext(hFile,&fileinfo));
return(count);
}
main()
{
directorio("C:", "*.*");
}