【问题标题】:How do I find all .exe files using the boost library?如何使用 boost 库查找所有 .exe 文件?
【发布时间】:2012-03-02 13:38:47
【问题描述】:

boost的功能和FindFirstFile有什么相似之处?我想在使用 boost 的文件夹中找到*.exe

例如:

HANDLE handle = FindFirstfile(buf, &finds);
while(FindNextFile(handle, &finds) { // using file }

【问题讨论】:

  • 所以你知道 Boost 但Boost.Filesystem 不是一个明显的候选者?
  • 我已针对质量和格式编辑了您的问题。以后,请查看编辑器中提供的帮助,以及FAQ(特别要密切关注“如何提问”部分)。

标签: c++ boost


【解决方案1】:

你可以使用directory_iterator:

#include <boost/filesystem.hpp>
using namespace std;
using namespace boost::filesystem;

...

path mypath("/where/ever/");

for(directory_iterator it( mypath ); ; ++it) {
    ...
}

并符合您的标准。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-10
    • 1970-01-01
    • 2023-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多