home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / lisp / lispnews / text0371.txt < prev    next >
Encoding:
Text File  |  1985-11-10  |  534 b   |  30 lines

  1. Here is a VERY simple "C" program that will patch the VMS image header to
  2. make the "hdrblkcnt" 1 instead of 0.  You can use this program any time
  3. you do a dumplisp and want to run it on VMS 4.0 (without having to recompile
  4. the basic Franz Lisp):
  5.  
  6. main(argc,argv)
  7. char *argv[];
  8. {
  9.     int i;
  10.     for(i = 1; i < argc; i++) patch(argv[i]);
  11. }
  12.  
  13. patch(filename)
  14. char *filename;
  15. {
  16.     int fd;
  17.     char hdrblkcnt = 1;
  18.  
  19.     fd = open(filename,2);
  20.     if (fd < 0) {perror("open"); return;}
  21.     lseek(fd,16,0);
  22.     write(fd,&hdrblkcnt,1);
  23.     close(fd);
  24. }
  25.  
  26.  
  27. David
  28. -------
  29.  
  30.