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

╄→尐↘猪︶ㄣ 提交于 2019-12-01 17:32:53

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/15052998/what-to-substitute-for-glob-t-and-glob-on-port-to-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!