Group: Time - Library: kernel32
Setting the date and time that a file was created
A procedure for setting file times
How to set Creation Date/Time for a folder (WinNT)
BOOL SetFileTime(
HANDLE hFile, // handle to file
CONST FILETIME *lpCreationTime, // creation time
CONST FILETIME *lpLastAccessTime, // last-access time
CONST FILETIME *lpLastWriteTime // last-write time
);
DECLARE INTEGER SetFileTime IN kernel32.dll;
INTEGER hFile,;
STRING @ lpCreationTime,;
STRING @ lpLastAccessTime,;
STRING @ lpLastWriteTime
hFile [in] Handle to the file for which to set the dates and times. The file handle must have been created with GENERIC_WRITE access to the file.
lpCreationTime [in] Pointer to a FILETIME structure that contains the date and time the file was created.
lpLastAccessTime [in] Pointer to a FILETIME structure that contains the date and time the file was last accessed.
lpLastWriteTime [in] Pointer to a FILETIME structure that contains the date and time the file was last written to.
If the function succeeds, the return value is nonzero.
As I found the VFP function FOPEN() can not create a file handle to be valid for this function, regardless of chosen attributes. So the only way to do it is the Win32 function OpenFile.