Topic: How to copy files to destination and copy files if only idate is older

Do you have an example to do following:


How to copy files to other destination and replace files if only the date is older

Regards,

Pierre

Re: How to copy files to destination and copy files if only idate is older

function CopyEx(ExistsFileName, NewFileName: string): boolean;
begin
    result := False;

    if GetFileLastWriteTime(ExistsFileName) > GetFileLastWriteTime(NewFileName) then
        result := CopyFile(ExistsFileName, NewFileName);
end;

// how to use
procedure Form1_Button6_OnClick (Sender: TObject; var Cancel: boolean);
begin
    if CopyEx('d:\1.bmp', 'd:\wmpnss_color32.bmp') then ShowMessage('Replaced') else ShowMessage('Fail');
end;
Dmitry.

Re: How to copy files to destination and copy files if only idate is older

спасибо, Thank you, Merci

Pierre P.