home *** CD-ROM | disk | FTP | other *** search
- *****************************************************************
- * Test program for FILEDATE, FILESIZE, FILETIME, FILETOUCH
- * FILE = T_FILES.PRG
- *****************************************************************
-
- * Copyright(c) 1991 -- James Occhiogrosso
-
- # include "inkey.ch"
-
- INITGLOBAL()
- SETCOLOR(colstd)
- CLEAR
-
- * Save original date and time of this program file,
- * and reset it to system date and time.
- filename = 't_files.prg'
- orig_date = FILEDATE(filename, DATE())
- orig_time = FILETIME(filename, TIME())
-
- * Stuff a space in keyboard to start the loop
- KEYBOARD CHR(32)
-
- DO WHILE INKEY(0) != K_ESC
-
- CLEAR
- * Display the original date and time settings
- @ 6, 10 SAY 'The size of .......... ' + UPPER(filename) + ;
- ' is ' + LTRIM(STR(FILESIZE(filename)))
- @ 8, 10 SAY 'It was dated ......... ' + DTOC(orig_date)
- @ 9, 10 SAY 'And had a time of .... ' + orig_time
-
- * Set date and time to system date and time
- FILETOUCH(filename)
-
- * Retrieve its date and time using FILEDATE and FILETIME
- @ 11, 10 SAY 'Its new date is ...... ' + ;
- DTOC(FILEDATE(filename))
- @ 12, 10 SAY 'And its new time is .. ' + FILETIME(filename)
-
- @ 15, 10 SAY 'Press any key to set date and time' + ;
- ' back to original values'
- INKEY(0)
-
- * Reset the file back to original values
- FILEDATE(filename, orig_date)
- FILETIME(filename, orig_time)
-
- * And display the original values
- @ 17, 10 SAY 'Date setting is now .. ' + ;
- DTOC(FILEDATE(filename))
- @ 18, 10 SAY 'Time setting is now .. ' + ;
- FILETIME(filename)
-
- @ 24, 10 SAY 'Press any key to begin again or Esc to exit'
-
- ENDDO
-
- CLEAR
- RETURN
-
-