DirectoryExists (C++)
Description
The following example creates a directory, C:\temp, if it does not already exist.
Code
#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!");
}
Uses
- System.SysUtils.DirectoryExists ( fr | de | ja )
- System.SysUtils.CreateDir ( fr | de | ja )
- System.SysUtils.Exception.Create ( fr | de | ja )