This function change date time on file.
Run in Windows but not run in Mac OS
This is message: syncthread.pas(213,15) Error: Identifier not found "TFileTime"
help me thanks
procedure myFileSetDateTime(const FileName: string; DateTime: TDateTime);
var
FileHandle: THandle;
FileTime: TFileTime;
SystemTime: TSystemTime;
begin
FileHandle := FileOpen(FileName, fmOpenWrite or fmShareDenyNone);
if FileHandle <> THandle(-1) then
begin
try
DateTimeToSystemTime(DateTime, SystemTime);
SystemTimeToFileTime(SystemTime, FileTime);
SetFileTime(FileHandle, @FileTime, @FileTime, @FileTime);
finally
FileClose(FileHandle);
end;
end
else
begin
// Gestisci l'errore se non è possibile aprire il file
raise Exception.Create('Impossibile aprire il file: ' + FileName);
end;
end;