Skip to content

Instantly share code, notes, and snippets.

@bluecmd
Created July 27, 2016 09:13
Show Gist options
  • Save bluecmd/a6b50efb74869d33ac83aeec744dca43 to your computer and use it in GitHub Desktop.
Save bluecmd/a6b50efb74869d33ac83aeec744dca43 to your computer and use it in GitHub Desktop.
#include <stdlib.h>
#include <stdio.h>
#include <glob.h>
int main(int argc, char *argv[]) {
glob_t globbuf;
glob("./test.[0-9]*.ctl", GLOB_NOSORT, NULL, &globbuf);
for(size_t i = 0; i < globbuf.gl_pathc; ++i) {
printf("Match: %s\n", globbuf.gl_pathv[i]);
}
globfree(&globbuf);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment