#include<iostream>
#include<io.h>
#include<vector>
#include <windows.h>
#include <stdio.h>
#include<string>
#include <opencv2/opencv.hpp>
using namespace std;
int get_files(std::string fileFolderPath, std::string fileExtension, std::vector<std::string>&file, std::vector<std::string>&NameVec)
{
std::string fileFolder = fileFolderPath + "\\*" + fileExtension;
std::string fileName;
std::string Name;
struct _finddata_t fileInfo;
long long findResult = _findfirst(fileFolder.c_str(), &fileInfo);
if (findResult == -1)
{
_findclose(findResult);
return 0;
}
bool flag = 0;
do
{
fileName = fileFolderPath + "\\" + fileInfo.name;
Name = fileInfo.name;
if (fileInfo.attrib == _A_ARCH)
{
file.push_back(fileName);
NameVec.push_back(Name);
}
} while (_findnext(findResult, &fileInfo) == 0);
_findclose(findResult);
将文件夹下指定文件拷贝到另外一个文件夹下c++
最新推荐文章于 2024-07-26 22:28:33 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)