GetLastWriteTime(Path: String): DateTime;
Path - directory, for which date and time of the last contents change must be found out.
The GetLastWriteTime method returns date and time of the last edit of a directory contents.
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: