Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File system object and date of last access
Message
From
08/04/2005 10:14:31
Bill Drew
Independent Consultant
Chicago, Illinois, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
File system object and date of last access
Environment versions
Visual FoxPro:
VFP 7
Miscellaneous
Thread ID:
01002609
Message ID:
01002609
Views:
78
When trying to weed out extraneous files. Is it a valid approach to detect date of last access using the filesystem object?

I could harvest dates of last access from all desktops and then if a file has not been used in x years, feel certain in deleting it.

I would also run checks against all places where there might be code references: scx, prg, vcx, etc.

But I haven't been able to make the filesystem object work.

local fso, f, s
fso = CreateObject("Scripting.FileSystemObject")
filespec = "c:\license.txt"
f = fso.GetFile(filespec)
Crlf = CHR(13)+CHR(10)
s = Uppe(filespec) +CRLF
s = s + "Created: " + f.DateCreated +CRLF
s = s + "Last Accessed: " + f.DateLastAccessed +CRLF
s = s + "Last Modified: " + f.DateLastModified
MESSAGEBOX(S)

This code errors on the line that reads the datelastaccessed property of the file object.

Further, is date of last access a true indicator that a file is unnecessary.

And even further can I count on the scripting host to be available and active.

Your thoughts?

Bill
Next
Reply
Map
View

Click here to load this message in the networking platform