Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Safe way to create a directory
Message
De
08/11/2001 06:42:47
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00578887
Message ID:
00578945
Vues:
19
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everyone,
>
>I've just thought about something and made a quick test. Usually we have this kind of code:
>
if not directory(m.lcDir)
>   md (m.lcDir)
>endif
>
>I decided to test it on "a" drive without disk inserted. To my surprise and relief, directory() function works fine. However, md command gave an error "File Access is denied". So, what do you think, what kind of code would be more correct? (Besides trapping for error, of course).
>
>Thanks in advance.
Nadya,
You should explcitly check device being ready (say with WSH) and directory() returning .f. doesn't mean you could create it. It doesn't check for device being ready nor hidden,system directories as documented. I'd use adir() instead.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform