有什么方法可以解决我对路径代码的搜索问题?

时间:2019-07-18 20:20:25

标签: c++ windows winapi

我有一个出于某种原因无法使用的代码。前几天,我在类似的帖子上发布了它,但是后来我找到了一种方法,现在由于某种原因该代码无法正常工作。我想从我执行的路径中搜索spesipic文件。

我尝试这样做

for (const auto& entry : fs::directory_iterator(path)) { // I can replace it with recursive_directory_iterator if i want ALL of the files
                if (entry.path().string().find(search) != string::npos) {
                    cout << entry.path().string() << endl;
                }
            }

结果很奇怪。如果我输入的字母超过1个,将不起作用;如果输入“ m”,则仅显示史诗游戏启动器;如果输入“ s”,则将显示很多漏洞文件

https://github.com/pach13/project/tree/master

0 个答案:

没有答案
相关问题