RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
FileCtrl.DirectoryExists Function

Determines whether a specified directory exists.

Pascal
function DirectoryExists(const Name: string): Boolean;
C++
Boolean DirectoryExists(const AnsiString Name);

Call DirectoryExists to determine whether the directory specified by the Name parameter exists. If the directory exists, the function returns true. If the directory does not exist, the function returns false. 

If a full path name is entered, DirectoryExists searches for the directory along the designated path. Otherwise, the Name parameter is interpreted as a relative path name from the current directory.

Note: The FileCtrl unit (Windows only) also contains a DirectoryExists function. However, the FileCtrl version is deprecated, and the SysUtils version preferred, even if the code does not need to be cross-platform.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!