c++ - 用什么替代 Windows 端口上的 glob_t 和 glob()?

标签 c++ windows porting glob

我有一些像这样的代码片段:

#include <glob.h>

glob_t globBuf;
const int result = glob(remoteFileName.c_str(), 0, 0, &globBuf);

if (result == GLOB_NOSPACE) {
  ...
} else if (result == GLOB_NOMATCH) {
  ...
} else {
  ...
}

但我在 Windows 上找不到 glob.h

我将在 Microsoft Windows 上使用什么来提供从 Linux 移植此代码的等效功能?

最佳答案

glob 是 POSIX 特有的东西,在 Windows 上不存在。在 Windows 上查看 FindFirstFile及其配套功能。

关于c++ - 用什么替代 Windows 端口上的 glob_t 和 glob()?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15052998/

相关文章:

c - 如何使用 MinGW 在命令行上编译 C 程序?

c# - 无法识别某些 C# 语法以转换为 VB.NET

c - 如何编译C程序?

c++ - 如何在 Windows 7 上获取 gethostid 行为?

c++ - 显式调用 typedef 类类型的析构函数的正式正确方法

c++ - 像 std::vector 中的元素一样就地合并

c++ - LNK2001 : unresolved external symbol threadIdx

Windows 中的 Objective-C

c++ - C/C++中的NaN比较规则

python - 在 WIndows 中为 Python 安装 FFMPEG