home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / bbs / dlp100.zip / FA.C next >
C/C++ Source or Header  |  1993-06-23  |  910b  |  38 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include "ra.h"
  4. main()
  5. {
  6.      char Path[128];
  7.      char WorkName[41];
  8.      char WorkPath[41];
  9.      char Line[80];
  10. unsigned int FileNum=0;
  11.      int i, j;
  12.  
  13. struct FILES FileRec;
  14.  
  15. RAEnvr = getenv("RA");
  16. strcpy (Path, RAEnvr);
  17. strcat (Path, "\\FILES.RA");
  18.  
  19. if((FILES_RA=fopen(Path,"rb"))==NULL)
  20.    { printf("\n\nUnable to open %s!\n", Path);
  21.      getch();
  22.      return(1);
  23.    }
  24. fprintf (stdout, "  %s %-35s %s\n\n", "File ", "Name", "Path");
  25.  
  26. while(fread(&FileRec, sizeof(FileRec), 1, FILES_RA)==1)
  27.      { FileNum++;
  28.        if(FileRec.NameSize)
  29.       { strncpy (WorkName, FileRec.Name, FileRec.NameSize);
  30.         WorkName[FileRec.NameSize]='\0';
  31.         strncpy (WorkPath, FileRec.FilePath, FileRec.FilePathSize);
  32.         WorkPath[FileRec.FilePathSize]='\0';
  33.         fprintf(stdout, "%5u\)  %-35s %-35s\n", FileNum, WorkName, WorkPath);
  34.       }
  35.      }
  36. fclose(FILES_RA);
  37. }
  38.