Example:
- we have a folder named A at C:\
- we want to create the folder named C at C:\A\B
- B does not exists so CreateDirectory('C:\A\B\C\'); wont work
Here is my solution:
CreateDirectories('C:\A\B\C\D\E\F\G\H\');
Simba Code:procedure CreateDirectories(const FilePath : String);
var
Folders : Array of String;
i : Integer;
begin
Folders := Explode('\',FilePath);
for i:=1 to (High(Folders)-1) do
CreateDirectory(Folders[0] + Between(Folders[0],Folders[i+1],FilePath));
CreateDirectory(FilePath);
end;

