home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a013 / 1.ddi / SOURCE.EXE / F_FITOUC.PRG < prev    next >
Encoding:
Text File  |  1991-01-25  |  710 b   |  31 lines

  1. *****************************************************************
  2. FUNCTION FILETOUCH (file_name)
  3. *****************************************************************
  4.  
  5. * Update date and time of a file to system date and time
  6.  
  7. * Copyright(c) 1991 -- James Occhiogrosso
  8.  
  9. LOCAL handle := 0, buffer := ' '
  10.  
  11. * Open file for read/write operation
  12. handle = FOPEN(file_name, 2)
  13.  
  14. * Return false if error opening file
  15. IF FERROR() != 0
  16.     RETURN(.F.)
  17. ENDIF
  18.  
  19. * Read first byte of file
  20. FREAD(handle, @buffer, 1)
  21.  
  22. * Reset file pointer to BOF
  23. FSEEK(handle, 0)
  24.  
  25. * Write byte back in same position
  26. FWRITE(handle, buffer, 1)
  27.  
  28. * Return value of FCLOSE in case an error occurred
  29. RETURN (FCLOSE(handle))
  30.  
  31.