📄 test3.cpp
字号:
//---------------------------------------------------------------------------
#pragma hdrstop
//---------------------------------------------------------------------------
#include <stdio.h>
//#include <dir.h>
#include <windows.h>
int main(int argc, char* argv[])
{
FILE *in;
char *buff;
long length;
if ((in = fopen("filelist.txt", "rt"))
== NULL)
{
fprintf(stderr, "Cannot open input file.\n");
return 1;
}
int stat;
stat = mkdir("c:\\found") | mkdir("c:\\notfound");
if (stat)
{
printf("Unable to create directory\n");
return 1;
}
fseek(in, 0L, 2);
length = ftell(in);
fseek(in, 0L, 0);
buff = new char[length+1];
fread(buff, length, 1, in);
buff[length] = '\0';
fclose(in);
struct ffblk ffblk;
int done;
char file1[256];
char file2[256];
done = findfirst("*.*",&ffblk,0);
while (!done)
{
sprintf(file1, "c:\\found\\%s", ffblk.ff_name);
sprintf(file2, "c:\\notfound\\%s", ffblk.ff_name);
if (strstr(buff, ffblk.ff_name))
CopyFile(ffblk.ff_name, file1, true);
else
CopyFile(ffblk.ff_name, file2, true);
done = findnext(&ffblk);
}
delete [] buff;
return 0;
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -