CreateDir fails with UNC path and recursive=True
Archives Forums/BlitzMax Bug Reports/CreateDir fails with UNC path and recursive=True
| ||
When trying to create recursively several folders in one go using a network path, CreateDir fails always. Problem is with the start string "\\" the CreateDir function does not take this into account inside the creation loop. Original: path=RealPath(path)+"/" While path Local i=path.find("/")+1 t:+path[..i] path=path[i..] Select FileType(t) Case FILETYPE_DIR Case FILETYPE_NONE Local s$=StripSlash(t) mkdir_ StripSlash(s),1023 If FileType(s)<>FILETYPE_DIR Return False Default Return False End Select Wend Possible fix: path=RealPath(path)+"/" Local i ?Win32 If path.StartsWith( "//" ) i=path.find("/",2)+1; t:+path[..i]; path=path[i..] ? While path i=path.find("/")+1 t:+path[..i] path=path[i..] Select FileType(t) Case FILETYPE_DIR Case FILETYPE_NONE Local s$=StripSlash(t) mkdir_ StripSlash(s),1023 If FileType(s)<>FILETYPE_DIR Return False Default Return False End Select Wend |