mirror of
https://gitlab.com/bztsrc/posix-uefi.git
synced 2025-01-01 03:25:52 +01:00
21 lines
450 B
C
21 lines
450 B
C
#include <uefi.h>
|
|
|
|
/**
|
|
* List directory contents
|
|
*/
|
|
int main(int argc, char **argv)
|
|
{
|
|
(void)argc;
|
|
(void)argv;
|
|
DIR *dh;
|
|
struct dirent *de;
|
|
|
|
if((dh = opendir("\\04_dirent"))) {
|
|
while ((de = readdir(dh)) != NULL) {
|
|
printf("%c %04x %s\n", de->d_type == DT_DIR ? 'd' : '.', de->d_type, de->d_name);
|
|
}
|
|
closedir(dh);
|
|
} else
|
|
fprintf(stderr, "Unable to open directory\n");
|
|
return 0;
|
|
}
|