Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Touch File
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00602053
Message ID:
00602154
Views:
34
>>>Ty Steve. It seems like a nice program, but I can't get it to work. I tried the example on the command line, e.g.:
>>>>* Retrieve a file’s date/time stamps
>>>>SET PROCEDURE TO FileTime ADDITIVE
>>>>oFileTime = CREATEOBJECT(“FileTimes”) <--this causes an error, stating "Unkown Member oFiles. I figure this isn't a big deal, i just deal with this by doing oFileTime.init.
>>>
>>>>llresult = oFileTime.GetFilesTime(lcfile, @ltCreate,;
>>>> @ltAccess, @ltModified)
>>>
>>>What would ltCreate look like? @var is simply a what? I tried leaving it blank and got nothing.
>>>
>>>>* Set a file’s date/time stamps
>>>>llresult = oFileTime.SetFilesTime(lcfile, ltCreate,;
>>>> ltAccess, ltModified)
>>>
>>>I tried simply using datetime() for the ltCreate, access, mod but got no change. I'm trying this on an exe, which i hope doesn't make a difference (though I saw some indicationt that it might, in the FileOpen API...)
>>>
>>>m
>>
>>Mike,
>>
>>The oFile member holds a reference to the FileOpenClose object that's used to do the necessary open and close. The file FileIO.prg contains this object's definition and should be available to the FileTime.prg.
>>
>>The parameters after lcfile, are the Creation Date/Time, Last Access Date/Time, and the Last Modification Date/Time. So, IOW, the routine expects 1 to 3 datetime data types. If you want to modify the last modification date time only, for example, you'd call SetFilesTime like this
llresult = oFileTime.SetFilesTime(lcfile, , , tModified)
>>
>>hth,
>
>No foxtools anymore? :-)
>
>
>You can also check for the FoxTouch function in the foxtools.fll to change datetime of files.
>
>See MSKB#Q114949

Hi Gerald,

I don't think you'd want to use the FoxTouch() function because it has a bug (as documented in my Extended Foxtools Help). What it does is stamp the file with the current UTC time, not the current local time.

Besides, it only does the last modification date/time. The above also changes the creation and last access datetimes.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform