/* * blogdx - Generate blog-style index.html file for files in directory */ #include <stdio.h> #include <string.h> #include "krcompat.h" #define DIRECTORY "<PAPA.HTML.TWOG>" #define DIRFILE "DIRECT.LST" #define OUTFILE "INDEX.HTML" #define MAXFNAME 132 int main () { FILE *dp; char fname[MAXFNAME]; printf(" 1 2 3\n 123456789012345678901234567890123456789\n"); dp = fopen(strcat(DIRECTORY, DIRFILE), "r"); if (dp == NULL) { printf("Could not open DIRECTORY list in %s", DIRECTORY); return 1; } while (fgets(fname, MAXFNAME, dp) != NULL) { if (strlen(fname) > 1 && fname[1] != ' ') /* if (strlen(fname) > 1 && fname[1] != ' ' && strchr(fname[1], ' ') != NULL) */ printf("%d:%s", strlen(fname), fname); } close(dp); return 0; }