Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to know if a directory exists ?
Message
De
29/10/2008 06:57:01
 
 
À
28/10/2008 18:01:41
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01357782
Message ID:
01357962
Vues:
20
>>>>how to know if a directory exist ?
>>>>and how to creat it if not exist ?
>>>
>>>
lcDir="w:\somepath\more path\SomeDir"
>>>if not directory(lcDir)
>>>    md (lcDir)
>>>endif
>>>
>>
>>Works with FILE() to dunnit, I seem to recall?
>
>I just tried it, file() returns .F., even if the directory exists. Also, in the cases where it does work (i.e. for files), file() has the nasty habit of finding files in places other than the specified place - which is not always the desired behavior.
>
>You can use adir(), with the appropriate parameters to include directories.

I recall using FILE() years ago, in VFP3 and fp2.6 to ascertain if there was a floppy in the drive. Can't remember the exact format of the usage.

Of course I wouldn't bother with this now that DIRE(), ADIR() exist.
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform