Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get file size
Message
 
À
25/07/2001 13:43:25
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00535088
Message ID:
00535206
Vues:
9
>>>Just curious, is there a way to get a file size without using ADIR()?
>>>John
>>
>>Sure. The Size property of the Windows Script Host's Scripting.FileSystemObject.
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
>>oFile = oFSO.GetFile(lcfile)
>>? oFile.Size
Natively, there's also FSIZE(), but you have to SET COMPATIBLE to ON (by default, it's off).
>
>george -
>
>i assume you need to have WSH installed on the machine to to this ?

Yes, but it's becoming more and more likely that this is the case (as Win2K and Win Me boxes increase). It's fairly easy to check if it is. Just use the registry class in the FFC to check for the entry of VBScript.RegExp. That'll tell you if one of the more recent versions is installed.

I made it a habit to check for the presence of it using a post-setup executable in VFP 6.0 and installing it if it wasn't present.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform