#include <stdio.h>
#include <stdlib.h>
#include <io.h>
void main( int argc,char * argv[] )
{
_finddata_t ft ;
char szPath[256] ;
int findresult,hs ;
printf("Please input path:");
fgets(szPath,13,stdin);
sprintf(szPath,"%s//*.*",szPath) ;
findresult = _findfirst(szPath,&ft) ;
hs = findresult ;
while (findresult!=-1 )
{
unsigned char isdir = ft.attrib ;
isdir <<= 3 ;
isdir >>= 7 ;
if ( isdir )
{
printf("%s <DIR>/n",ft.name);
}
else
{
printf("%s/n",ft.name);
}
findresult = _findnext(hs,&ft) ;
}
}
以e://download为例