>Hello everyone,
>I have an annoying little problem here. My company's file structure on the server has a main customer folder, and then most companies who are our customers have their own folder inside that main folder. For those that don't already have a folder though, my program needs to be able to add thier folder with the name being their 6-character company code. The problem now is that some of the companies have a space in their company code, and the MKDIR and MD commands don't allow me to properly add these folders.
>
>You see the DIRECTORY() function will tell me that folder:
>
>k:\customer\BUZZ 1\forms
>
>does not exist. Then I say:
>
>MKDIR k:\customer\BUZZ 1\forms
>
>and a folder is created named 'k:\customer\BUZZ', because it doesn't recognize anything after the space! It seems that DIRECTORY() interprets the command correctly, but MKDIR, and MD don't like it. Does anyone know a way around this?
You need to use name resolution; the VFP parser is treating the space as a delmitier. Try:
MKDIR ("k:\customer\buzz 1\forms")
You can stick the directory in a string variable and use that:
cMyDir = "k:\customer\buzz 1\forms"
MKDIR (cMyDir)
Using macro expansion will not work reliably because of the parsing issue:
cMyDir = "k:\customer\buzz 1\forms"
MKDIR &cMyDir && screws up
MKDIR "&cMyDir" && works
cMyDir = "c:\Foo"
MKDIR &cMyDir && works
MKDIR "&cMyDir" && screws up
Name resolution doesn't have the parsing issues with or without a space.