IDirectory.GetLastWriteTime

Syntax

GetLastWriteTime(Path: String): DateTime;

Parameters

Path - directory, for which date and time of the last contents change must be found out.

Description

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

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;

On executing the example it is checked if the directory specified in the sPath parameter is present in the file system. If the directory exists, date and time of its last contents change are displayed in the development environment console.

See also:

IDirectory