Also delete file before copying if destination is a directory on Darwin OS

git-svn-id: trunk@49202 -
This commit is contained in:
pierre 2021-04-14 08:06:54 +00:00
parent 2f90dbbd44
commit 1e527e7a1e

View File

@ -6199,8 +6199,18 @@ Var
{$endif UNIX}
begin
{ First delete file on Darwin OS to avoid codesign issues }
if (Defaults.SourceOS=Darwin) and FileExists(Dest) then
SysDeleteFile(Dest);
if (Defaults.SourceOS=Darwin) then
begin
D:=IncludeTrailingPathDelimiter(Dest);
If DirectoryExists(D) then
begin
D:=D+ExtractFileName(Src);
if FileExists(D) then
SysDeleteFile(D);
end
else if FileExists(Dest) then
SysDeleteFile(Dest);
end;
Log(vlInfo,SInfoCopyingFile,[Src,Dest]);
FIn:=TFileStream.Create(Src,fmopenRead or fmShareDenyNone);
Try