ADD: Verify after copy under macOS

This commit is contained in:
Alexander Koblov 2024-02-27 22:32:14 +03:00
commit 2c94aa22b8
3 changed files with 25 additions and 6 deletions

View file

@ -3,7 +3,7 @@
-------------------------------------------------------------------------
This unit contains platform dependent functions dealing with operating system.
Copyright (C) 2006-2023 Alexander Koblov (alexx2000@mail.ru)
Copyright (C) 2006-2024 Alexander Koblov (alexx2000@mail.ru)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -873,6 +873,16 @@ begin
if Result <> feInvalidHandle then
begin
FileCloseOnExec(Result);
{$IF DEFINED(DARWIN)}
if (Mode and fmOpenDirect <> 0) then
begin
if (FpFcntl(Result, F_NOCACHE, 1) = -1) then
begin
FileClose(Result);
Exit(feInvalidHandle);
end;
end;
{$ENDIF}
Result:= FileLock(Result, Mode and $FF);
end;
end;
@ -904,6 +914,16 @@ begin
if Result <> feInvalidHandle then
begin
FileCloseOnExec(Result);
{$IF DEFINED(DARWIN)}
if (Mode and fmOpenDirect <> 0) then
begin
if (FpFcntl(Result, F_NOCACHE, 1) = -1) then
begin
FileClose(Result);
Exit(feInvalidHandle);
end;
end;
{$ENDIF}
Result:= FileLock(Result, Mode and $FF);
end;
end;

View file

@ -3,7 +3,7 @@
-------------------------------------------------------------------------
This unit contains Unix specific functions
Copyright (C) 2015-2023 Alexander Koblov (alexx2000@mail.ru)
Copyright (C) 2015-2024 Alexander Koblov (alexx2000@mail.ru)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -48,6 +48,9 @@ const
{$ELSEIF DEFINED(HAIKU)}
FD_CLOEXEC = 1;
O_CLOEXEC = $00000040;
{$ELSEIF DEFINED(DARWIN)}
O_CLOEXEC = $1000000;
F_NOCACHE = 48;
{$ELSE}
O_CLOEXEC = 0;
{$ENDIF}

View file

@ -112,10 +112,6 @@ constructor TFileSystemCopyMoveOperationOptionsUI.Create(AOwner: TComponent; AFi
begin
inherited;
{$IFDEF DARWIN}
chkVerify.Visible := False;
{$ENDIF}
{$IFDEF MSWINDOWS}
cbCopyOwnership.Visible := False;
cbCopyPermissions.Visible := True;