Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File system object and date of last access
Message
De
08/04/2005 10:14:31
Bill Drew
Independent Consultant
Chicago, Illinois, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
File system object and date of last access
Versions des environnements
Visual FoxPro:
VFP 7
Divers
Thread ID:
01002609
Message ID:
01002609
Vues:
72
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform