首个自主编程项目。 C ++。 Windows 7的。 尝试验证已成功复制的文件夹以及所有子文件夹和文件。
到目前为止,伪代码看起来像这样:
//First create a window to interact with
// two 'browse' fields for folder/file locations, one 'compare' button to execute
//use window to choose folders to compare
//get a list of subfolders and files
// maybe a list of file paths?
//go file-by-file and compare
// compare file paths? ignore folder name changes?
//COMPARE FILES
// COMPARE SIZE BY FINDING END OF FILE
// IF NOT SAME POSITION, DIFF. FILE, RETURN
// IF SAME SIZE, CONTINUE
// read your files into large buffers of memory and compare each buffer using memcmp() you will improve performance
// break up into 1-10-50 megabytes, use memcmp on those chunks
// loop until end is reached
首先:概念声音是什么?查找文件夹,获取文件夹中的项目列表,多次比较项目,一旦找到差异就中断,返回位置。比较文件是我对如何实际实现的唯一想法,其余的将需要进一步学习。
第二:我是否应该尝试创建一个基本窗口,或者我应该首先在IDE中获得基本想法?