Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check if a folder already exists?
Message
De
02/08/2000 21:55:24
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00400144
Message ID:
00400190
Vues:
16
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform