Posted on 2013-02-16 15:26
盛胜 阅读(434)
评论(0) 编辑 收藏 引用
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #include <stdio.h>
#include <io.h>
int main ( void )
{
_finddata_t fileDir;
char * dir= "d:\\temp\\*.*" ;
long lfDir;
if ((lfDir = _findfirst(dir,&fileDir))==-1l)
printf ( "No file is found\n" );
else {
printf ( "file list:\n" );
do {
printf ( "%s\n" ,fileDir.name);
} while ( _findnext( lfDir, &fileDir ) == 0 );
}
_findclose(lfDir);
return 0;
}
|