1 /* 2 * Copyright 2008-2009, Axel Dörfler, axeld@pinc-software.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include <dirent.h> 8 #include <stdio.h> 9 10 11 int 12 main(int argc, char** argv) 13 { 14 DIR* dir = opendir("."); 15 16 while (true) { 17 dirent* dirent = readdir(dir); 18 if (dirent == NULL) 19 break; 20 21 printf("Entry: dev %ld, ino %Ld, name \"%s\"\n", dirent->d_dev, 22 dirent->d_ino, dirent->d_name); 23 //printf(" left: %u, next: %d\n", dir->entries_left, dir->next_entry); 24 } 25 26 closedir(dir); 27 return 0; 28 } 29