[cparse-cvs] CVS update: cparse/dir-test.c

Christian Lynbech clynbech at common-lisp.net
Mon Nov 29 20:22:58 UTC 2004


Update of /project/cparse/cvsroot/cparse
In directory common-lisp.net:/tmp/cvs-serv10631

Modified Files:
	dir-test.c 
Log Message:
modified to print all entries

Date: Mon Nov 29 21:22:57 2004
Author: clynbech

Index: cparse/dir-test.c
diff -u cparse/dir-test.c:1.1 cparse/dir-test.c:1.2
--- cparse/dir-test.c:1.1	Wed Nov 24 21:29:32 2004
+++ cparse/dir-test.c	Mon Nov 29 21:22:56 2004
@@ -4,14 +4,16 @@
 main() {
   DIR *handle;
   struct dirent *entry;
-  int x;
+  int x = 0;
 
-  printf("\n\n============\n");
-  handle = opendir("/home/tedchly");
-  for (x=0; x<=5; x++) {
+  printf("DIRTEST/c\n");
+  handle = opendir("/tmp");
+  entry = (struct dirent *)1;
+  while (handle && entry) {
     entry = readdir(handle);
     if (entry)
-      printf("Entry: %s\n", entry->d_name);
+      printf("%d: %s\n", x++, entry->d_name);
   }
+  closedir(handle);
 }
 




More information about the Cparse-cvs mailing list