Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File Accessed Date
Message
From
06/05/2004 09:51:14
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00901355
Message ID:
00901545
Views:
14
>>>>Hi,
>>>> If you open a windows explorer and right-click on
>>>>on a file name (say MY_TEXT.TXT) and then left-click
>>>>on Properties, the File "Accessed" Date is one of the
>>>>three dates that is presents (the other two are Date
>>>>"Created" and Date "Modified").
>>>> Is there an API function or a VFP function that
>>>>will return the File "Accessed" Date?
>>>>Thanks!
>>>>Terry Harris
>>>
>>>This is available either with the Windows Script Host or through the API.>>>* lcfile is the file name to look at.
>>>oFile = oFSO.GetFile(lcfile)
>>>? oFile.DateLastAccessedIf this isn't an option you can use my Windows Time or Window Filenames programming from the download section.
>>
>>
>>Thanks George for the reply.
>>When I use the following code in a PRG, the Date Last Accessed
>>is always today's date. What's up?
>>
>>
>>oFSO = CreateObject( "Scripting.FileSystemObject")
>>lcFile = GetFile()
>>oFile = oFSO.GetFile(lcFile)
>>? oFile.DateLastAccessed
>>WAIT
>>
>
>Terry,
>
>It's pretty simple. When you selected the file via GETFILE() you accessed it, and thus, the date/time stamp changed.

George,
This may be something like the Heisenberg Uncertainty Principle.
If you touch it, you change it.
Can you think of a way to get the DateLastAccessed of files in a
folder without changing the date in the process?
Thanks,
Terry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform