//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "DirectoryExists.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: DirectoryExists
// Routine: SysUtils.DirectoryExists
// Routine: SysUtils.CreateDir
// Method: SysUtils.Exception.Create

// BeginCode
/*
The following example creates a directory ‘C:\temp’ if it
does not already exist.
}
*/
#include <Filectrl.hpp>
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  if (!DirectoryExists("c:\\temp"))
  {
	if (!CreateDir("C:\\temp"))
	  throw Exception("Cannot create c:\\temp directory.");
  }
  if (!CreateDir("C:\\temp"))
	throw Exception("Cannot create C:\\temp again!");
}
// EndCode
// EndExample: DirectoryExists
//---------------------------------------------------------------------------
