IFileSystemInfo.CreationTime

Syntax

CreationTime: DateTime;

Description

The CreationTime property determines date and time of file creation.

Comments

The property is supported only in Windows.

Example

Executing the example requires the C:\1.txt file.

Add a link to the IO system assembly.

Sub UserProc;
Var
    FileSInfo: IFileSystemInfo;
Begin
    FileSInfo := New FileInfo.Attach("c:\1.txt");
    If FileSInfo.Exists Then
        Debug.WriteLine("Creation date: " + FileSInfo.CreationTime.ToString);
        Debug.WriteLine("Date of the last opening: " + FileSInfo.LastAccessTime.ToString);
        FileSInfo.LastWriteTime := DateTime.Now;
    End If;
    Dispose FileSInfo;
End Sub UserProc;

After executing the example it is checked if the C:\1.txt file exists. If the file exists, date and time of its creation and of its last opening are displayed in the development environment console. The current date is also set as date of the last change.

See also:

IFileSystemInfo