6

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

#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 {
  ...
}

但我glob.h在 Windows 上找不到。

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

4

1 回答 1

2

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

于 2013-02-24T15:04:27.510 回答