aboutsummaryrefslogtreecommitdiff
path: root/CPP/Windows/FileFind.h
diff options
context:
space:
mode:
authorIgor Pavlov <87184205+ip7z@users.noreply.github.com>2024-05-14 00:00:00 +0000
committerIgor Pavlov <87184205+ip7z@users.noreply.github.com>2024-05-15 23:55:04 +0500
commitfc662341e6f85da78ada0e443f6116b978f79f22 (patch)
tree1be1cc402a7a9cbc18d4eeea6b141354c2d559e3 /CPP/Windows/FileFind.h
parent5b39dc76f1bc82f941d5c800ab9f34407a06b53a (diff)
download7zip-24.05.tar.gz
7zip-24.05.tar.bz2
7zip-24.05.zip
24.0524.05
Diffstat (limited to 'CPP/Windows/FileFind.h')
-rw-r--r--CPP/Windows/FileFind.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/CPP/Windows/FileFind.h b/CPP/Windows/FileFind.h
index 11408d0..f68673a 100644
--- a/CPP/Windows/FileFind.h
+++ b/CPP/Windows/FileFind.h
@@ -99,12 +99,12 @@ public:
99 99
100 CFileInfoBase() { ClearBase(); } 100 CFileInfoBase() { ClearBase(); }
101 void ClearBase() throw(); 101 void ClearBase() throw();
102 bool SetAs_StdInFile();
102 103
103 #ifdef _WIN32 104 #ifdef _WIN32
104 105
105 bool Fill_From_ByHandleFileInfo(CFSTR path); 106 bool Fill_From_ByHandleFileInfo(CFSTR path);
106 void SetAsDir() { Attrib = FILE_ATTRIBUTE_DIRECTORY; } // |= (FILE_ATTRIBUTE_UNIX_EXTENSION + (S_IFDIR << 16)); 107 void SetAsDir() { Attrib = FILE_ATTRIBUTE_DIRECTORY; } // |= (FILE_ATTRIBUTE_UNIX_EXTENSION + (S_IFDIR << 16));
107 void SetAsFile() { Attrib = 0; }
108 108
109 bool IsArchived() const { return MatchesMask(FILE_ATTRIBUTE_ARCHIVE); } 109 bool IsArchived() const { return MatchesMask(FILE_ATTRIBUTE_ARCHIVE); }
110 bool IsCompressed() const { return MatchesMask(FILE_ATTRIBUTE_COMPRESSED); } 110 bool IsCompressed() const { return MatchesMask(FILE_ATTRIBUTE_COMPRESSED); }
@@ -132,8 +132,8 @@ public:
132 UInt32 GetWinAttrib() const { return Get_WinAttribPosix_From_PosixMode(mode); } 132 UInt32 GetWinAttrib() const { return Get_WinAttribPosix_From_PosixMode(mode); }
133 133
134 bool IsDir() const { return S_ISDIR(mode); } 134 bool IsDir() const { return S_ISDIR(mode); }
135 void SetAsDir() { mode = S_IFDIR; } 135 void SetAsDir() { mode = S_IFDIR | 0777; }
136 void SetAsFile() { mode = S_IFREG; } 136 void SetFrom_stat(const struct stat &st);
137 137
138 bool IsReadOnly() const 138 bool IsReadOnly() const
139 { 139 {
@@ -173,7 +173,6 @@ struct CFileInfo: public CFileInfoBase
173 // bool FollowReparse(CFSTR path, bool isDir); 173 // bool FollowReparse(CFSTR path, bool isDir);
174 #else 174 #else
175 bool Find_DontFill_Name(CFSTR path, bool followLink = false); 175 bool Find_DontFill_Name(CFSTR path, bool followLink = false);
176 void SetFrom_stat(const struct stat &st);
177 #endif 176 #endif
178}; 177};
179 178
@@ -278,19 +277,19 @@ typedef CFileInfo CDirEntry;
278struct CDirEntry 277struct CDirEntry
279{ 278{
280 ino_t iNode; 279 ino_t iNode;
281 #if !defined(_AIX) 280#if !defined(_AIX) && !defined(__sun)
282 Byte Type; 281 Byte Type;
283 #endif 282#endif
284 FString Name; 283 FString Name;
285 284
286 /* 285 /*
287 #if !defined(_AIX) 286#if !defined(_AIX) && !defined(__sun)
288 bool IsDir() const 287 bool IsDir() const
289 { 288 {
290 // (Type == DT_UNKNOWN) on some systems 289 // (Type == DT_UNKNOWN) on some systems
291 return Type == DT_DIR; 290 return Type == DT_DIR;
292 } 291 }
293 #endif 292#endif
294 */ 293 */
295 294
296 bool IsDots() const throw(); 295 bool IsDots() const throw();
@@ -311,12 +310,12 @@ public:
311 bool Fill_FileInfo(const CDirEntry &de, CFileInfo &fileInfo, bool followLink) const; 310 bool Fill_FileInfo(const CDirEntry &de, CFileInfo &fileInfo, bool followLink) const;
312 bool DirEntry_IsDir(const CDirEntry &de, bool followLink) const 311 bool DirEntry_IsDir(const CDirEntry &de, bool followLink) const
313 { 312 {
314 #if !defined(_AIX) 313#if !defined(_AIX) && !defined(__sun)
315 if (de.Type == DT_DIR) 314 if (de.Type == DT_DIR)
316 return true; 315 return true;
317 if (de.Type != DT_UNKNOWN) 316 if (de.Type != DT_UNKNOWN)
318 return false; 317 return false;
319 #endif 318#endif
320 CFileInfo fileInfo; 319 CFileInfo fileInfo;
321 if (Fill_FileInfo(de, fileInfo, followLink)) 320 if (Fill_FileInfo(de, fileInfo, followLink))
322 { 321 {