递归文件夹下所有文件
2014-07-23 15:31
155 查看
void DealFileInterfaceImpl::RecursionToFind(CString strTempPath,FILELIST& sfilelist) { CString strPath = strTempPath + ALL_FILE; CString strTmp = _T(""); TARGETFILE sFile; char* s_char = NULL; CFileFind tempFind; BOOL bFound; bFound=tempFind.FindFile(strPath); while(bFound) //遍历所有文件 { bFound=tempFind.FindNextFile(); if(tempFind.IsDots()) //如果找到的是当前或者上层目录则结束本次查找 { continue; } if(tempFind.IsDirectory()) //找到的是文件夹,则遍历该文件夹下的文件 { //USES_CONVERSION; //strTmp = tempFind.GetFileName(); //s_char = W2A(strTmp); //sFile.strFileName = s_char; strTmp=tempFind.GetFilePath(); //s_char=W2A(strTmp); //sFile.strFilePath = s_char; //sfilelist.push_back(sFile); RecursionToFind(strTmp,sfilelist);//递归调用 } else { USES_CONVERSION; strTmp = tempFind.GetFileName(); s_char = W2A(strTmp); sFile.strFileName = s_char; strTmp=tempFind.GetFilePath(); s_char=W2A(strTmp); sFile.strFilePath = s_char; boost::hash<std::string> string_hash; std::string strFileID = s_char; sFile.ulFilesID = string_hash(strFileID); s_char=W2A(CMD5Checksum::GetMD5(strTmp)); sFile.strFilesMD5 = s_char; sfilelist.push_back(sFile); } } tempFind.Close(); }
相关文章推荐
- 递归打开一个文件夹所有下面的文件|软件开发掌握
- c# 递归删除文件夹下的所有文件
- java递归读取文件夹中的所有文件以及路径
- Linux下递归打印一个文件夹下的所有文件夹和文件
- 递归删除一个文件夹下的所有文件c#代码
- 相当实用的——Java递归删除指定文件夹下的所有文件
- Java递归删除文件夹中的所有文件
- 递归方式遍历文件夹下的所有文件及子文件夹 [php]
- 递归遍历一个文件夹下面的所有文件
- 用递归方法实现读取文件夹下所有文件信息
- 递归删除某个文件夹下面的所有文件和文件夹
- 递归得到指定文件夹下所有.mdb文件
- 用递归列出文件夹所有文件夹和文件
- 用递归做文件夹中所有文件的提取(感谢[titilima ]的文章)
- 递归删除当前文件夹及当前文件夹下的所有文件
- asp.net 删除文件夹,指定文件夹,删除文件夹和所有文件,删除权限设置,递归删除文件夹目录及文件
- 递归删除文件夹下所有文件
- 可视化webpart基础开发——TreeView控件读取文档库中的所有文件夹和文件(递归方法读取) .
- 递归遍历某文件夹下所有文件的算法
- 递归删除指定文件夹下所有文件