Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining A File's Type
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00326276
Message ID:
00326293
Views:
24
>I am giving the user the ability to select a file with GETFILE()
>
>I then want to be able to tell what type of file they selected. For example, .DOC = Word Document, .SCX = VFP Form, .BMP = Bitmap.
>
>Any ideas?

Hi Kevin,

I was wondering if this was what you were after in a recent post. Here's the answer: The Windows Script Host (mild fanfare, please). The file system object has a type property for both files and folders. Here's a sample:
oFSO = CREATEOBJECT('Scripting.FileSystemObject')
oFile = oFSO.GetFile(lcfile)
? oFile.Type
What that returns depends solely on the file, but basically it'll match what's shown in the Windows Explorer. How's that?
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform