UPD: Wfx-plugins - display read-only delete confirmation only for files with NTFS attributes

This commit is contained in:
Alexander Koblov 2026-05-29 20:06:09 +03:00
commit d90959dbf0
2 changed files with 5 additions and 7 deletions

View file

@ -47,7 +47,7 @@ type
implementation
uses
DCOSUtils, uLng, WfxPlugin;
DCOSUtils, uFileProperty, uLng, WfxPlugin;
constructor TWfxPluginDeleteOperation.Create(aTargetFileSource: IFileSource;
var theFilesToDelete: TFiles);
@ -122,9 +122,10 @@ var
logOptions: TLogOptions;
begin
Result := False;
aFileName := aFile.Path + aFile.Name;
aFileName := aFile.FullPath;
if FileIsReadOnly(aFile.Attributes) then
if (aFile.AttributesProperty.ClassType = TNtfsFileAttributesProperty) and
(TNtfsFileAttributesProperty(aFile.AttributesProperty).IsReadOnly) then
begin
case FDeleteReadOnly of
fsoogNone:
@ -150,9 +151,6 @@ begin
repeat
bRetry := False;
//if FileIsReadOnly(aFile.Attributes) then
// mbFileSetReadOnly(aFileName, False);
with FWfxPluginFileSource.WfxModule do
if aFile.IsDirectory then // directory
begin

View file

@ -977,7 +977,7 @@ end;
function TNtfsFileAttributesProperty.IsReadOnly: Boolean;
begin
Result := (FAttributes and FILE_ATTRIBUTE_READONLY) <> 0;
Result := (FAttributes and (FILE_ATTRIBUTE_READONLY or FILE_ATTRIBUTE_HIDDEN or FILE_ATTRIBUTE_SYSTEM)) <> 0;
end;
function TNtfsFileAttributesProperty.IsHidden: Boolean;