home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP04.EXE / CHP0405.PRG < prev   
Encoding:
Text File  |  1991-04-30  |  618 b   |  24 lines

  1. /*
  2.    Listing 4.5 Checkexe()
  3.    Author: Joe Booth
  4.    Excerpted from "Clipper 5: A Developer's Guide"
  5.    Copyright (c) 1991 M&T Books
  6.                       501 Galveston Drive
  7.                       Redwood City, CA 94063-4728
  8.                       (415) 366-3600
  9. */
  10.  
  11. //───── NOTE: must compile with the /N option!
  12.  
  13. function checkexe(file_name)
  14. LOCAL fh, fbuf1 := " ", fbuf2 := " ", retval := .f.
  15. if (fh := fopen(file_name)) >= 0
  16.    Fread(fh, @fbuf1, 1)
  17.    Fread(fh, @fbuf2, 1)
  18.    fclose(fh)
  19.    retval := ( asc(fbuf1) == 77 .and. asc(fbuf2) == 90 )
  20. endif
  21. return retval
  22.  
  23. // end of file CHP0405.PRG
  24.