Attach(Path: String);
Path - a directory, with which an object of this class is linked.
The Attach designer creates an object used to work with directories and links it with a directory, path to which is passed by the Path parameter.
A directory specified in the Path parameter could be absent. Use the Exists method to check whether this directory is present.
Sub Main;
Var
Dir: IDirectoryInfo;
Begin
Dir:=New DirectoryInfo.Attach("c:\New_folder");
If Not Dir.Exists Then
Dir.Create;
End If;
Dispose Dir;
End Sub Main;
After executing the example, the New_folder directory is created if it does not exist.
See also: