IDirectory.GetLastAccessTime

Syntax

GetLastAccessTime(Path: String): DateTime;

Parameters

Path - directory, which date and time of the last access to it must 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;

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 the last access to it are displayed in the development environment console.

See also:

IDirectory