Creates a new subdirectory.
procedure MkDir(const S: string); overload; procedure MkDir(P: PChar); overload;
MkDir(const AnsiString S); MkDir(const char * P);
System
MkDir creates a new subdirectory with the path specified by string S or P. The last item in the path cannot be an existing file name.
Delphi Examples:
{ The following sample code sets the directory of DirectoryListBox1 to C:\WINDOWS when the form is created. When Button1 is pressed, a subdirectory called mytemp is added to C:\WINDOWS, but note that it is not updated in DirectoryListBox1 until Button2 is pressed and Update is called. Note: A EInOutError will occur if you add a directory that already exists. Also, you must add the new directory to your current path to see the magic happen. } procedure TForm1.Button1Click(Sender: TObject); begin MkDir(Edit1.Text); end; procedure TForm1.Button2Click(Sender: TObject); begin DirectoryListBox1.Update; end; procedure TForm1.FormCreate(Sender: TObject); begin DirectoryListBox1.Directory := 'c:\WINDOWS'; end;
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|