(MacOS not tested)
Code: Select all
EnableExplicit
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
CompilerElse
ImportC ""
system(cmd.p-utf8)
EndImport
CompilerEndIf
Procedure CreateDirectoryEx(DirPath.s)
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Windows
RunProgram(GetEnvironmentVariable("COMSPEC"), "/c mkdir " + #DQUOTE$ + DirPath + #DQUOTE$, "", #PB_Program_Wait | #PB_Program_Hide)
If FileSize(DirPath) = -2
ProcedureReturn #True
EndIf
CompilerDefault
If Not system("mkdir -p " + #DQUOTE$ + DirPath + #DQUOTE$)
ProcedureReturn #True
EndIf
CompilerEndSelect
EndProcedure
Define.s Path = GetHomeDirectory() + "test1/test2/tesatäöü"
Debug CreateDirectoryEx(Path)