Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2018-01-30 03:15:34 +0300
committerKornel <kornel@geekhood.net>2018-01-30 03:35:06 +0300
commit866a06f5a0c0ede11979504a318e150030aa7a11 (patch)
treebb8a2795afb445aa46167232254384ed82caf518 /CPP/7zip/UI/Agent
parentda28077952faf9e716ed7987b842d31617a10125 (diff)
18.0118.01
Diffstat (limited to 'CPP/7zip/UI/Agent')
-rw-r--r--CPP/7zip/UI/Agent/Agent.cpp9
-rw-r--r--CPP/7zip/UI/Agent/Agent.h6
2 files changed, 14 insertions, 1 deletions
diff --git a/CPP/7zip/UI/Agent/Agent.cpp b/CPP/7zip/UI/Agent/Agent.cpp
index e52e47d0..1c2e3397 100644
--- a/CPP/7zip/UI/Agent/Agent.cpp
+++ b/CPP/7zip/UI/Agent/Agent.cpp
@@ -1217,7 +1217,12 @@ STDMETHODIMP CAgentFolder::GetFolderProperty(PROPID propID, PROPVARIANT *value)
NWindows::NCOM::CPropVariant prop;
if (propID == kpidReadOnly)
- prop = _agentSpec->IsThereReadOnlyArc();
+ {
+ if (_agentSpec->Is_Attrib_ReadOnly())
+ prop = true;
+ else
+ prop = _agentSpec->IsThereReadOnlyArc();
+ }
else if (_proxy2)
{
const CProxyDir2 &dir = _proxy2->Dirs[_proxyDirIndex];
@@ -1564,6 +1569,7 @@ STDMETHODIMP CAgent::Open(
{
COM_TRY_BEGIN
_archiveFilePath = filePath;
+ _attrib = 0;
NFile::NFind::CFileInfo fi;
_isDeviceFile = false;
if (!inStream)
@@ -1572,6 +1578,7 @@ STDMETHODIMP CAgent::Open(
return ::GetLastError();
if (fi.IsDir())
return E_FAIL;
+ _attrib = fi.Attrib;
_isDeviceFile = fi.IsDevice;
}
CArcInfoEx archiverInfo0, archiverInfo1;
diff --git a/CPP/7zip/UI/Agent/Agent.h b/CPP/7zip/UI/Agent/Agent.h
index ae4026d6..7ba96f4a 100644
--- a/CPP/7zip/UI/Agent/Agent.h
+++ b/CPP/7zip/UI/Agent/Agent.h
@@ -241,6 +241,7 @@ public:
CAgentFolder *_agentFolder;
UString _archiveFilePath;
+ DWORD _attrib;
bool _isDeviceFile;
#ifndef EXTRACT_ONLY
@@ -252,6 +253,11 @@ public:
IInArchive *GetArchive() const { if ( _archiveLink.Arcs.IsEmpty()) return 0; return GetArc().Archive; }
bool CanUpdate() const;
+ bool Is_Attrib_ReadOnly() const
+ {
+ return _attrib != INVALID_FILE_ATTRIBUTES && (_attrib & FILE_ATTRIBUTE_READONLY);
+ }
+
bool IsThereReadOnlyArc() const
{
FOR_VECTOR (i, _archiveLink.Arcs)