mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Elevate change file attributes operation
This commit is contained in:
parent
7018ab2327
commit
26eec57bf1
1 changed files with 6 additions and 8 deletions
|
|
@ -51,10 +51,8 @@ implementation
|
|||
|
||||
uses
|
||||
uGlobs, uLng, DCDateTimeUtils, uFileSystemUtil,
|
||||
DCOSUtils, DCStrUtils, DCBasicTypes
|
||||
{$IF DEFINED(MSWINDOWS)}
|
||||
, uAdministrator
|
||||
{$ELSEIF DEFINED(UNIX)}
|
||||
DCOSUtils, DCStrUtils, DCBasicTypes, uAdministrator
|
||||
{$IF DEFINED(UNIX)}
|
||||
, BaseUnix, DCUnix
|
||||
{$ENDIF}
|
||||
;
|
||||
|
|
@ -182,7 +180,7 @@ begin
|
|||
if (aTemplateProperty as TFileAttributesProperty).Value <>
|
||||
(aFile.Properties[fpAttributes] as TFileAttributesProperty).Value then
|
||||
begin
|
||||
if mbFileSetAttr(
|
||||
if FileSetAttrUAC(
|
||||
aFile.FullPath,
|
||||
(aTemplateProperty as TFileAttributesProperty).Value) <> 0 then
|
||||
begin
|
||||
|
|
@ -196,7 +194,7 @@ begin
|
|||
if (aTemplateProperty as TFileModificationDateTimeProperty).Value <>
|
||||
(aFile.Properties[fpModificationTime] as TFileModificationDateTimeProperty).Value then
|
||||
begin
|
||||
if not mbFileSetTime(
|
||||
if not FileSetTimeUAC(
|
||||
aFile.FullPath,
|
||||
DateTimeToFileTime((aTemplateProperty as TFileModificationDateTimeProperty).Value),
|
||||
0,
|
||||
|
|
@ -212,7 +210,7 @@ begin
|
|||
if (aTemplateProperty as TFileCreationDateTimeProperty).Value <>
|
||||
(aFile.Properties[fpCreationTime] as TFileCreationDateTimeProperty).Value then
|
||||
begin
|
||||
if not mbFileSetTime(
|
||||
if not FileSetTimeUAC(
|
||||
aFile.FullPath,
|
||||
0,
|
||||
DateTimeToFileTime((aTemplateProperty as TFileCreationDateTimeProperty).Value),
|
||||
|
|
@ -228,7 +226,7 @@ begin
|
|||
if (aTemplateProperty as TFileLastAccessDateTimeProperty).Value <>
|
||||
(aFile.Properties[fpLastAccessTime] as TFileLastAccessDateTimeProperty).Value then
|
||||
begin
|
||||
if not mbFileSetTime(
|
||||
if not FileSetTimeUAC(
|
||||
aFile.FullPath,
|
||||
0,
|
||||
0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue