IFile.SetCreationTime

Syntax

SetCreationTime(FileName: String; CreationTime: DateTime);

Parameters

FileName. Path and name of the file, which date and time of creation must be changed.

CreationTime. Date and time that should be set.

Description

The SetCreationTime method changes date and time of file creation passed by the FileName parameter.

Comments

The method is supported only in Windows.

Example

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

Add a link to the IO system assembly.

Sub UserProc;
Begin
    If File.Exists("c:\New_folder\1.txt"Then
        File.SetCreationTime("c:\New_folder\1.txt",DateTime.Now);
    End If;
End Sub UserProc;

After executing the example it is checked if the C:\New_folder\1.txt file exists. If the file exists, its creation date will be replaced with the current one.

See also:

IFile