-
-
Save jklmnn/61a8f887319f98093c136fd8dd656b28 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <dirent.h> | |
#include <stdio.h> | |
void ls(char *path) | |
{ | |
DIR *dir; | |
struct dirent *file; | |
dir = opendir(path); | |
while((file = readdir(dir)) != NULL) | |
{ | |
printf(" %s\n", file->d_name); | |
} | |
closedir(dir); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ls(char *path); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment