Name

MkDir Procedure

Syntax

procedure MkDir(const Directory: string)

Description

Call MkDir to create a directory. If the directory cannot be created, Delphi reports an I/O error using the Windows error code, such as Error_Already_Exists if the directory already exists.

You can include or omit a trailing backslash character in the directory name.

MkDir is not a real procedure.

Example

// Create a directory, but only if it does not already exist.
procedure MakeDirectory(const Directory: string);
var
  Search: TSearchRec;
begin
  if FindFirst(Directory, faDirectory, Search) = 0 then
    FindClose(Search)
  else
    MkDir(Directory);
end;

See Also

ChDir Procedure, GetDir Procedure, IOResult Function, RmDir Procedure
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset