Listing directories (dirent.h)
Në shqip: Leximi i dosjeve në C
ShpjegimiSQ
Me opendir() dhe readdir() nga <dirent.h> kalon nëpër skedarët e një dosjeje në Linux dhe macOS — p.sh. për të gjetur të gjithë skedarët .c.
EnglishEN
With opendir() and readdir() from <dirent.h> you go through the files of a folder on Linux and macOS — e.g. to find every .c file.
Si ta mendosh
Si të lexosh listën e dosjeve në dollap.
Lexoje në anglisht
Like reading the list of folders in a filing cabinet.
Shembull kodic
DIR *d = opendir(".");
struct dirent *e;
while ((e = readdir(d)) != NULL) puts(e->d_name);
closedir(d);