home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / crclists_401.lzh / CrcLists / GenScript.c < prev    next >
C/C++ Source or Header  |  1990-11-16  |  750b  |  37 lines

  1. /*
  2.  *    This simple little program generates a script suitable for
  3.  *    running by the CLI "execute" command, to create crclists
  4.  *    for any range of disks in the AmigaLibDisk set.
  5.  *
  6.  *    Typical use is:
  7.  *
  8.  *        GenScript >ram:j 100 150
  9.  *        Execute ram:j
  10.  */
  11.  
  12. #include <stdio.h>
  13.  
  14. #define FMT1    "find >find.out AmigaLibDisk%d: -type f -print\n"
  15. #define FMT2    "brik >Disk%03.3d.crc -Gbf find.out\n"
  16. #define FMT3    "brik -C Disk%03.3d.crc\n"
  17.  
  18. main (argc, argv)
  19. int argc;
  20. char *argv[];
  21. {
  22.     int start, stop;
  23.  
  24.     if (argc != 3) {
  25.         printf ("usage: genscript startnumber stopnumber\n");
  26.     } else {
  27.         start = atoi (argv[1]);
  28.         stop = atoi (argv[2]);
  29.         while (start <= stop) {
  30.             printf (FMT1, start);
  31.             printf (FMT2, start);
  32.             printf (FMT3, start);
  33.             start++;
  34.         }
  35.     }
  36. }
  37.