Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get file size
Message
 
To
25/07/2001 13:43:25
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00535088
Message ID:
00535206
Views:
10
>>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform