Browse Source

ADD: Copy extended attributes under Haiku

Alexander Koblov 2 years ago
parent
commit
cfad170205
1 changed files with 15 additions and 2 deletions
  1. 15 2
      components/doublecmd/dcosutils.pas

+ 15 - 2
components/doublecmd/dcosutils.pas

@@ -3,7 +3,7 @@
     -------------------------------------------------------------------------
     This unit contains platform dependent functions dealing with operating system.
 
-    Copyright (C) 2006-2021 Alexander Koblov ([email protected])
+    Copyright (C) 2006-2022 Alexander Koblov ([email protected])
 
     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
@@ -31,6 +31,9 @@ uses
 {$IFDEF UNIX}
   , BaseUnix, DCUnix
 {$ENDIF}
+{$IFDEF HAIKU}
+  , DCHaiku
+{$ENDIF}
 {$IFDEF MSWINDOWS}
   , JwaWinBase, Windows
 {$ENDIF}
@@ -564,6 +567,16 @@ begin
           if Assigned(Errors) then Errors^[caoCopyOwnership]:= GetLastOSError;
         end;
       end;
+{$IF DEFINED(HAIKU)}
+      if caoCopyXattributes in Options then
+      begin
+        if not mbFileCopyXattr(sSrc, sDst) then
+        begin
+          Include(Result, caoCopyXattributes);
+          if Assigned(Errors) then Errors^[caoCopyXattributes]:= GetLastOSError;
+        end;
+      end;
+{$ENDIF}
     end
     else
     begin
@@ -599,7 +612,7 @@ begin
         end;
       end;
 
-{$IFDEF LINUX}
+{$IF DEFINED(LINUX) or DEFINED(HAIKU)}
       if caoCopyXattributes in Options then
       begin
         if not mbFileCopyXattr(sSrc, sDst) then