From Help DIRECTORY() to check for a drectory/folder:
DIRECTORY(cDirectoryName)
Returns true (.T.) if the specified directory is found on disk.
From Help MKDIR (Make Directory) how to create a diectory or folder:
SET DEFAULT TO HOME( ) && Restore Visual FoxPro directory
MKDIR mytstdir && Create a new directory
CHDIR mytstdir && Change to the new directory
= GETDIR( ) && Display the Select Directory dialog box
SET DEFAULT TO HOME( ) && Restore Visual FoxPro directory
RMDIR mytstdir && Remove the new directory
= GETDIR( ) && Display the Select Directory dialog box
****************************
LOCAL myDir
myDir = "C:\DirectoryName"
IF ! DIRECTORY(myDire)
MD &myDir
ENDIF
&& DO WHATEVER YOU WANT
****************************
This is same as what jack has written, but more specific to your question.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.