Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Directory
Message
From
07/12/1999 13:58:39
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00299900
Message ID:
00299908
Views:
16
>How to I determine if a specific directory exist on the C: Drive

Lessee... the DIRECTORY() function is one way: IF DIRECTORY(cDirPathinVar)
ADIR(): IF ADIR(aTempArray,cDirPathInVar,'D') > 0

and the ever-popular Scripting.FileSystemObject's FolderExists method:

oFSO = CREATEOBJ('Scripting.FileSystemObject')
IF oFSO.FolderExists(cDirPathInVar)

This is far from a canonical list of ways to do this, but I figure one of the three should work for you...

The two native VFP mechanisms have quirks wrt LFNs that VFP mishandles (things with multiple . characters seem to cause problems as an example) and the Scripting.FileSystemObject requires you to have installed the VBSCRIPT engines, usually placed on the system as a part of the Windows Scripting Host install.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform