Gehe zu deutscher Webseite

ViaThinkSoft CodeLib

This article is in:
CodeLibProgramming aidsC / C++

void read_mangled_files() {
        glob_t paths;
        int globresult;
        char **p;

        globresult = glob("test/*.txt", 0, NULL, &paths);
        if (globresult == 0) {
                for (p=paths.gl_pathv; *p != NULL; ++p) {
                        printf("Reading file %s ...\n", *p);
                        // Do something
                }
                globfree(&paths);
        }
}
Daniel Marschall
ViaThinkSoft Co-Founder