UPD: Wfx-plugins - read-only check

(cherry picked from commit 0fa82eceb8)
This commit is contained in:
Alexander Koblov 2026-05-29 23:24:14 +03:00
commit 2f17b77ddb
3 changed files with 19 additions and 3 deletions

View file

@ -82,6 +82,8 @@ const
S_IRWXU = S_IRUSR or S_IWUSR or S_IXUSR;
S_IRWXG = S_IRGRP or S_IWGRP or S_IXGRP;
S_IRWXO = S_IROTH or S_IWOTH or S_IXOTH;
S_IRUGO = S_IRUSR or S_IRGRP or S_IROTH;
S_IWUGO = S_IWUSR or S_IWGRP or S_IWOTH;
S_IXUGO = S_IXUSR or S_IXGRP or S_IXOTH;
{ POSIX setuid(), setgid(), and sticky bit }

View file

@ -124,8 +124,7 @@ begin
Result := False;
aFileName := aFile.FullPath;
if (aFile.AttributesProperty.ClassType = TNtfsFileAttributesProperty) and
(TNtfsFileAttributesProperty(aFile.AttributesProperty).IsReadOnly) then
if aFile.AttributesProperty.IsReadOnly then
begin
case FDeleteReadOnly of
fsoogNone:

View file

@ -256,6 +256,8 @@ type
// Is it a symbolic link.
function IsLink: Boolean; virtual;
function IsReadOnly: Boolean; virtual;
// Retrieves raw attributes.
function GetAttributes: TFileAttrs; virtual;
@ -283,7 +285,8 @@ type
// Is it a symbolic link.
function IsLink: Boolean; override;
function IsReadOnly: Boolean;
function IsReadOnly: Boolean; override;
function IsHidden: Boolean;
class function GetDescription: String; override;
@ -306,6 +309,8 @@ type
// Is it a symbolic link.
function IsLink: Boolean; override;
function IsReadOnly: Boolean; override;
function IsOwnerRead: Boolean;
function IsOwnerWrite: Boolean;
function IsOwnerExecute: Boolean;
@ -944,6 +949,11 @@ begin
Result := fpS_ISLNK(FAttributes);
end;
function TFileAttributesProperty.IsReadOnly: Boolean;
begin
Result:= False;
end;
// ----------------------------------------------------------------------------
function TNtfsFileAttributesProperty.Clone: TNtfsFileAttributesProperty;
@ -1018,6 +1028,11 @@ begin
Result:= ((FAttributes and S_IFMT) = S_IFLNK);
end;
function TUnixFileAttributesProperty.IsReadOnly: Boolean;
begin
Result:= (((FAttributes and S_IRUGO) <> 0) and ((FAttributes and S_IWUGO) = 0));
end;
function TUnixFileAttributesProperty.IsOwnerRead: Boolean;
begin
Result:= False;