This is ftwtest.c in view mode; [Download] [Up]
#include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include "pdftw.h" extern int alphasort(); static int checkfile(s,st,flag) char *s; struct stat *st; int flag; { printf("name=\"%s\" flag=0x%x\n",s,flag); return 0; } main(ac, av) int ac; char *av[]; { register int i; register int j; struct dirent **list; if (ac != 2) { fprintf(stderr, "usage: %s dirname\n", av[0]); exit(1); } if (chdir(av[1]) < 0) { perror(av[1]); exit(1); } if ((i = ftw(".", checkfile, 10 )) < 0) { perror("Error walking directory"); exit(1); } exit(0); }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.