Ad blocker interference detected!
Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers
Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.
Definition (Delphi 6, 2007, 2010):
function CreateDir(const Dir: string): Boolean;
Creates a directory in the current directory when using a relative path otherwise the directory is made at the absolute path given. True will be returned if the directory creation was successful and false when an error occurred. When false you can use GetLastError to retrieve the value of it's failure.
CreateDir is a wrapper function for the CreateDirectoryA (Delphi 6), CreateDirectoryW (Delphi 2010) API which is the ansi version of CreateDirectory.
(Known issues / Documentation clarifications / Things to be aware of)
procedure TForm1.btnCreateDirectoriesClick(Sender: TObject); begin CreateDir('C:\test'); SetCurrentDir('C:\test'); //set the new current directory to C:\test CreateDir('InsideTestDir'); //creates directory C:\test\InsideTestDir CreateDir('..\InRootDir'); //creates C:\InRootDir end;
Using the following form:
object Form1: TForm1 Left = 571 Top = 138 Width = 169 Height = 96 Caption = 'Form1' Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style =  OldCreateOrder = False PixelsPerInch = 96 TextHeight = 13 object btnCreateDirectories: TButton Left = 32 Top = 16 Width = 97 Height = 25 Caption = 'Create Directories' TabOrder = 0 OnClick = btnCreateDirectoriesClick end end
(Please provide links to items specifically related to this item.)
(Please leave your name with your comment.)