Icon CreateDirectory

Unit: Internal

Available In: Server Applications

procedure CreateDirectory(const Directory: String)

The CreateDirectory procedure creates the directory specified in the input parameter. The specified directory path can contain intermediate directories, but those intermediate directories must exist and the procedure will only create the final directory in the path. If the directory cannot be created for any reason, an exception will be raised.

Information The specified directory path should be an absolute path. Relative paths are permitted, but they rely on the current working directory. The current working directory is a per-process setting and is not reliable in a multi-threaded setting like the web server.

Examples

if (not DirectoryExists('C:\temp\backup')) then
   CreateDirectory('C:\temp\backup');
Image