home *** CD-ROM | disk | FTP | other *** search
- *****************************************************************
- FUNCTION FILETOUCH (file_name)
- *****************************************************************
-
- * Update date and time of a file to system date and time
-
- * Copyright(c) 1991 -- James Occhiogrosso
-
- LOCAL handle := 0, buffer := ' '
-
- * Open file for read/write operation
- handle = FOPEN(file_name, 2)
-
- * Return false if error opening file
- IF FERROR() != 0
- RETURN(.F.)
- ENDIF
-
- * Read first byte of file
- FREAD(handle, @buffer, 1)
-
- * Reset file pointer to BOF
- FSEEK(handle, 0)
-
- * Write byte back in same position
- FWRITE(handle, buffer, 1)
-
- * Return value of FCLOSE in case an error occurred
- RETURN (FCLOSE(handle))
-
-