views:

262

answers:

1

Need some help in creating function which can create folders recursively with giving path:

C:\TestFolder\Another\AndAnother

Delphi function MkDir returning IOerror = 3.

MkDir('C:\TestFolder\Another\AndAnother');

Thanks in advance

+31  A: 

Use

ForceDirectories('C:\TestFolder\Another\AndAnother');

(This is a standard RTL function, found in SysUtils.pas. Hence you do not need to create your own function, even though that wouldn't have been difficult.)

Andreas Rejbrand