Code: Alles auswählen
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Windows
#Path_Slash$ = "\"
CompilerDefault
#Path_Slash$ = "/"
CompilerEndSelect
Procedure.i CreatePath(Path$)
Protected CountOfDirectories, i
Protected TempPath$
Path$ = Trim(Path$, #Path_Slash$)
CountOfDirectories = CountString(Path$, #Path_Slash$) + 1
For i = 1 To CountOfDirectories
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
If i = 1
TempPath$ = StringField(Path$, i, #Path_Slash$)
Continue
EndIf
CompilerEndIf
TempPath$ + #Path_Slash$ + StringField(Path$, i, #Path_Slash$)
If FileSize(TempPath$) <> -2 And Not CreateDirectory(TempPath$)
ProcedureReturn #False
EndIf
Next
ProcedureReturn #True
EndProcedure
;Debug CreatePath("/home/username/myproject/codes/gui")
;Debug CreatePath("C:\Dokumente und Einstellungen\Benutzername\Programmieren\Mein Projekt\GUI")
https://github.com/SicroAtGIT/PureBasic ... iv-Rebirth
Pfad: FileSystem/CreatePath