用什么替代Windows端口上的glob_t和glob()? [英] What to substitute for glob_t and glob() on port to Windows?
本文介绍了用什么替代Windows端口上的glob_t和glob()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一些类似于以下代码段的代码:
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 {
...
}
但是我在Windows上找不到glob.h
.
But I'm not finding glob.h
on windows.
我将在Microsoft Windows上使用什么功能来提供等效功能以从Linux移植此代码?
What would I use on Microsoft Windows to provide equivalent functionality to port this code from Linux?
推荐答案
glob
是POSIX专用的东西,在Windows上不存在.在Windows上,查看
glob
is a POSIX specific thing, and does not exist on Windows. On Windows look at the FindFirstFile
and it companion functions.
这篇关于用什么替代Windows端口上的glob_t和glob()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文