Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating folders as needed
Message
 
To
20/03/2005 23:02:14
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00997745
Message ID:
00997746
Views:
14
This message has been marked as the solution to the initial question of the thread.
>Thought I knew how to do this until I actually tried :-)
>
>Seeking recommendations on the most elegant way to test if a specific folder exists and to create it if it does not.
>
>TIA
lcFolder = 'c:\myNewFolder'
if not directory(lcFolder)
   try
      MD (lcFolder)
   catch
      ? "Invalid folder name, insufficient rights, or some other problem"
   endtry
endif
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform