IDirectory.GetLastWriteTime

Syntax

GetLastWriteTime(Path: String): DateTime;

Parameters

Path - a directory for which date and time of the last content change should be found out.

Description

The GetLastWriteTime method returns date and time of the last edit of a directory content.

Example

Sub UserProc(sPath: String);
Var
    Culture: ICultureInfo;
    d: DateTime;
Begin
    If Directory.Exists(sPath) Then
        Culture := CultureInfo.Current;
        d := Directory.GetLastWriteTime(sPath);
        Debug.WriteLine("Date and time of last content change: " +
            Culture.FormatLongDate(d) + Culture.FormatTime(d));
    End If;
End Sub UserProc;

While executing this example it is checked whether directory, specified in the parameter sPath, is present in file system. If a directory exists, date and time of its last content change are displayed in development environment console.

See also:

IDirectory