Patrick Kelley 8fd444092b initial
2025-05-07 15:35:15 -04:00

23 lines
416 B
C++

#include <dirent.h>
#include <stdio.h>
int main()
{ const char* path ="./*";
DIR* dir = opendir(path);
if(!dir)
{ printf("ERROR: opendir");
return 1;
}
struct dirent* entry = 0;
while(entry = readdir(dir))
{ if (!entry)
{ printf("ERROR: readdir");
return 2;
}
printf("Filename: %s\t\t Location in Directory Stream: %ld\n",
entry->d_name,telldir(dir));
}
closedir(dir);
return 0;
}