Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Netherlands
 Boudewijn Lutgerink
 To: Mikha sutanto
  Where is Mikha sutanto?
 Singapore
 Singapore
 Mikha sutanto
 Tags
Subject: RE: Change DateTime File Programatically
Thread ID: 50924 Message ID: 50928 # Views: 5 # Ratings: 0
Version: Visual FoxPro 8 Category: General VFP Topics
Date: Tuesday, September 07, 2004 9:11:43 AM         
   


> Hi,
> AnyOne Knows How to Change Date And Time File from VFP programatically.
> What Function should I Use ?
> Thanks for Help.

depends on what datetime stamp you want to change.
By simply doing a dir on the file changes the date accessed.
By doing some alteration in the file changes the date modified.
using foxtouch in foxtools changes the modify date as well.
the code for foxtouch is as follows.
set library to home()+"foxtools"
foxtouch("someFileName", yyyy, mm, dd, hh, mm, ss)


rewriting the content to a new file, deleting the old file and renaming the new file to the old file might work as well.
LOCAL lnOut, lnIn, lcLineOut
lnOut = FOPEN("filetoread.exe")
lnIn = FCREATE("filetowrite.exe")

DO WHILE NOT FEOF( lnOut)
	lcLineOut = FGETS(lnOut)
	FPUTS(lnIn, lcLineOut)
ENDDO
FCLOSE(lnIn)
FCLOSE(lnOut)

erase filetoread.exe
rename filetowrite.exe to filetoread.exe


This code changes the make date of the file.

Boudewijn LutgeĀ®ink
There are 10 types of people: Those that do understand binary calculations and those that do not.

ENTIRE THREAD

Change DateTime File Programatically Posted by Mikha sutanto @ 9/7/2004 8:38:02 AM
RE: Change DateTime File Programatically Posted by Boudewijn Lutgerink @ 9/7/2004 9:11:43 AM
RE: Change DateTime File Programatically Posted by Mikha sutanto @ 9/7/2004 9:36:40 AM