glob/globfree--找出匹配模式的路径名
语法
#include <glob.h> int glob(const char *pattern, int flags, int (*errfunc) (const char *epath, int eerrno), glob_t *pglob); void globfree(glob_t *pglob);
解析
The glob() function searches for all the pathnames matching pattern according to the rules used by the shell (see glob(7)).
glob()用于搜索路径下所有匹配的文件,便于后续处理。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步