Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check if a folder already exists?
Message
From
02/08/2000 21:55:24
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00400144
Message ID:
00400190
Views:
15
>I know you can use the FILE() command to check to see if a file exists, but how can you check to see if a folder exists and create it if it does not? Nothing I have tried works.
IF ADIR(aFileArray,"C:\MyFolder\MyMaybeFolder","D") = 0
   *  No folder, no file
ELSE
   IF "D" $ aFileArray(1,5)
      *  It's a folder
   ELSE
      *  It's a file or a volume label
   ENDIF
ENDIF
There's also the DIRECTORY() function.

>
>Thanks!
>Colombo.
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
Next
Reply
Map
View

Click here to load this message in the networking platform