《电脑报》1994年合订 / 软件操作与技巧 阅读文章

独立使用Locate功能

#include"dos.h"
#include"dir.h"
#include"string.h"
void search(char *path,char *file)
{
struot ffblk *ffblk=(struct ffblk *)malloc(sizeof (struct ffblk));
char *pathused=(char *)malloc(strlen(path)+14;
stpcpy(stpcpy(pathused,path),file);
if (findfirst(pathused,ffblk,o)==o)
do
printf("%s\n",ffblk->ff_name);
while(findnext(ffblk)==0;
stpcpy(stpcpy(pathused,path),"*.*"); if(findirst(pathused,ffblk,FA_DIREC)==O && strcmp(ffblk->ff_name,".")!=0)
do {
stpcpy(stpcpy(stpcpy(pathused,path),ffblk->ff_name),"\\");
search(pathused,file);
} while(findnext(ffblk)==o && strcmp(ffblk->ff_name,".")!=o);
}

main(int argo,char *argv)
{
search(strupr(argv),argv);
}

广州市第62中学 庄泗华

ESC 返回 PgUp/PgDn 翻页 software-archive.tifan.la 关于