>Dear All,
>
>We are using VFP5 and are finding problems using MKDIR under Win 2000.
>
>The problem specifically occurs when we get the windows tempfolder and attempt to create a new folder within a subfolder. Attempting to create 1 folder at a time does not cause a problem and if other non-windows folders are used, there is not a problem.
>
>The error can be re-produced using the code below.
>
>Any help, or pointers to an easy workaround would be appreciated.
>
>Thanks
>
>Mace
>
>LOCAL lcTempPath, lnSize, lcCreatePath
>
>lcTempPath = SPACE(255)
>lnsize = 255
>
>DECLARE INTEGER GetTempPath IN WIN32API INTEGER, STRING @
>
>lnSize = GetTempPath( lnSize, @lcTempPath)
>
>lcTempPath = SUBSTR( lcTempPath, 1, lnSize)
>IF RIGHT( lcTempPath, 1) <> "\"
> lcTempPath = lcTempPath + "\"
>ENDIF
>
>lcCreatePath = lcTempPath + "Hello\World"
>
>*-- This error always returns directory already exists
>MKDIR (lcCreatePath)
Macer,
You can't do it this way. You have to create the parent directory prior to creating the child IOW, you have to create the "Hello" folder before you create the "World" child folder.
BTW, you don't necessarily have to resort to the function call to the API to get the temp path. Try GETENV('TEMP').
George
Ubi caritas et amor, deus ibi est