home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / povnet / testpov.c < prev    next >
C/C++ Source or Header  |  1995-02-09  |  785b  |  37 lines

  1. // --- testpov.c
  2. //     compile with Borland C
  3.  
  4. #include <stdio.h>
  5. #include <conio.h>
  6. #include <stdlib.h>
  7. #include <dir.h>
  8. #include <dos.h>
  9. #include <string.h>
  10.  
  11. int main(int argc, char *argv[])
  12. {
  13.     if (argc > 1)    {
  14.         char fname[128], *cp, cmd[200];
  15.         struct ffblk ff;
  16.         memset(fname, 0, 13);
  17.         strncpy(fname, argv[1], 120);
  18.         cp = fname+strlen(fname);
  19.         strcpy(cp, ".pov");
  20.         if (findfirst(fname, &ff, 0) != -1)    {
  21.             if (ff.ff_attrib && FA_ARCH)
  22.                 printf("\n%s is being rendered.", ff.ff_name);
  23.             else    {
  24.                 printf("\n------ %s has been rendered ------", ff.ff_name);
  25.                 strcpy(cp, ".out");
  26.                 sprintf(cmd, "type %s", fname);
  27.                 system(cmd);
  28.                 strcpy(cp, ".err");
  29.                 sprintf(cmd, "type %s", fname);
  30.                 system(cmd);
  31.             }
  32.         }
  33.     }
  34.     return 0;
  35. }
  36.  
  37.