简体   繁体   中英

What to substitute for glob_t and glob() on port to Windows?

I have some code like this snippet:

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

But I'm not finding glob.h on windows.

What would I use on Microsoft Windows to provide equivalent functionality to port this code from Linux?

glob is a POSIX specific thing, and does not exist on Windows. On Windows look at the FindFirstFile and it companion functions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM