TP2 ex2 revu

master
esterfreyja 1 year ago
parent 38e7a0a94e
commit 2848643ec0

Binary file not shown.

@ -125,9 +125,12 @@ void listDirContent(char *leDossier)
fileAbsolPath = (char*)malloc(path_length); fileAbsolPath = (char*)malloc(path_length);
while((lesEntrees = readdir(dir))) while((lesEntrees = readdir(dir)))
{ {
fileAbsolPath = my_strcat((char *)leDossier, lesEntrees->d_name, path_length); if(lesEntrees->d_type == DT_REG || lesEntrees->d_type == DT_DIR)
{
fileAbsolPath = my_strcat((char *)leDossier, lesEntrees->d_name, path_length); //La consigne indique les fichiers, mais l'exemple montre aussi des dossiers...
showFileInfos(fileAbsolPath); showFileInfos(fileAbsolPath);
} }
}
free(fileAbsolPath); free(fileAbsolPath);
closedir(dir); closedir(dir);
} }

Loading…
Cancel
Save