CreationTime: DateTime;
The CreationTime property determines date and time of a file creation.
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;
While executing the example the existence of a file 1.txt is checked. If the file exists, date and time of its creation and of its last opening are displayed in development environment console. Also current date is set as date of the last change.
See also: