opendir
abrir, mostrar y cerrar directorios
opendir
#include <dirent.h>
DIR *opendir(const char *dirname);#include <dirent.h>
#include <stdio.h>
int main() {
DIR *dir = opendir("/path/to/dir");
if (dir == NULL) {
printf("No se pudo abrir el directorio\n");
return 1;
}
// leer los archivos y subdirectorios aquí
closedir(dir);
return 0;
}readdir
Last updated