IDirectory.GetLastAccessTime

Syntax

GetLastAccessTime(Path: String): DateTime;

Parameters

Path - a directory which date and time of the last access to it should be obtained.

Description

The GetLastAccessTime method returns date and time of the last access to a directory.

Example

Sub UserProc(sPath: String);
Var
    Culture: ICultureInfo;
    d: DateTime;
Begin
    If Directory.Exists(sPath) Then
        Culture := CultureInfo.Current;
        d := Directory.GetLastAccessTime(sPath);
        Debug.WriteLine("Date and time of last access: " +
            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 the last access to it are displayed in development environment console.

See also:

IDirectory