#include #include #define BSIZE (2024*10) int main(int argc,char *argv[]) { char comm[1024]; char base[1014]; FILE *fp; char line[BSIZE]; if (argc < 2) strcpy(base,"."); else strcpy(base,argv[1]); printf("\n"); sprintf(comm,"find %s -name \"*.pdf\" -print >tmp-pdf.tmp",base); system(comm); printf("

PDF documents in this folder

\n
    \n"); fp = fopen("tmp-pdf.tmp","r"); while (fgets(line,BSIZE-2,fp) !=NULL) { if (line[strlen(line)-1] == '\n') { line[strlen(line)-1]=0; } printf("
  1. %s \n",line,line); } printf("
\n\n"); fclose(fp); sprintf(comm,"find %s -name \"*.html\" -print >tmp-pdf.tmp",base); system(comm); printf("

HTML documents in this folder

\n
    \n"); fp = fopen("tmp-pdf.tmp","r"); while (fgets(line,BSIZE-2,fp) !=NULL) { if (line[strlen(line)-1] == '\n') { line[strlen(line)-1]=0; } printf("
  1. %s \n",line,line); } printf("
\n\n"); fclose(fp); printf("\n"); return(0); }