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>2017-08-29 22:49:43 +0300
committerKornel <kornel@geekhood.net>2017-08-29 22:49:43 +0300
commitb5dc853b2496447f0a54b3b25cb2659b575c56ef (patch)
tree82b48a2ca0f97915b2aeeb7ae9456711f13cd49a /CPP/Windows
parent2efa10565ac395d2ce9a679ead46e70fb2f963eb (diff)
17.0117.01
Diffstat (limited to 'CPP/Windows')
-rw-r--r--CPP/Windows/FileDir.cpp9
-rw-r--r--CPP/Windows/FileDir.h13
2 files changed, 22 insertions, 0 deletions
diff --git a/CPP/Windows/FileDir.cpp b/CPP/Windows/FileDir.cpp
index a7164b6b..72e0b7f7 100644
--- a/CPP/Windows/FileDir.cpp
+++ b/CPP/Windows/FileDir.cpp
@@ -128,6 +128,15 @@ bool SetFileAttrib(CFSTR path, DWORD attrib)
return false;
}
+
+bool SetFileAttrib_PosixHighDetect(CFSTR path, DWORD attrib)
+{
+ if ((attrib & 0xF0000000) != 0)
+ attrib &= 0x3FFF;
+ return SetFileAttrib(path, attrib);
+}
+
+
bool RemoveDir(CFSTR path)
{
#ifndef _UNICODE
diff --git a/CPP/Windows/FileDir.h b/CPP/Windows/FileDir.h
index b13d1cca..154ed973 100644
--- a/CPP/Windows/FileDir.h
+++ b/CPP/Windows/FileDir.h
@@ -15,7 +15,20 @@ bool GetWindowsDir(FString &path);
bool GetSystemDir(FString &path);
bool SetDirTime(CFSTR path, const FILETIME *cTime, const FILETIME *aTime, const FILETIME *mTime);
+
+
bool SetFileAttrib(CFSTR path, DWORD attrib);
+
+/*
+ Some programs store posix attributes in high 16 bits of windows attributes field.
+ Also some programs use additional flag markers: 0x8000 or 0x4000.
+ SetFileAttrib_PosixHighDetect() tries to detect posix field, and it extracts only attribute
+ bits that are related to current system only.
+*/
+
+bool SetFileAttrib_PosixHighDetect(CFSTR path, DWORD attrib);
+
+
bool MyMoveFile(CFSTR existFileName, CFSTR newFileName);
#ifndef UNDER_CE