summaryrefslogtreecommitdiff
path: root/test/misc/dirent.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-01-28 10:59:43 +0000
committerEric Andersen <andersen@codepoet.org>2003-01-28 10:59:43 +0000
commit46de710e624b2e578d9adf3bf44de5513867fba3 (patch)
treede9542a5b9d93f4677e9c5710bc3a0a88db54cd5 /test/misc/dirent.c
parent6bfd8e2b2044c6673371dd0302c02d62cc9a1acb (diff)
Add a couple of tests
Diffstat (limited to 'test/misc/dirent.c')
-rw-r--r--test/misc/dirent.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/misc/dirent.c b/test/misc/dirent.c
new file mode 100644
index 000000000..885990bf2
--- /dev/null
+++ b/test/misc/dirent.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <dirent.h>
+
+int main(int argc, char **argv)
+{
+
+ DIR *dirh;
+ struct dirent *dirp;
+ static char mydir[20] = "/tmp";
+
+ if ((dirh = opendir(mydir)) == NULL) {
+ perror("opendir");
+ return 1;
+ }
+
+ for (dirp = readdir(dirh); dirp != NULL; dirp = readdir(dirh)) {
+ printf("Got dir entry: %s\n",dirp->d_name);
+ }
+
+ closedir(dirh);
+ return 0;
+}
+