mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 11:08:02 +02:00
Also delete file before copying if destination is a directory on Darwin OS
git-svn-id: trunk@49202 -
This commit is contained in:
parent
2f90dbbd44
commit
1e527e7a1e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user