Procházet zdrojové kódy

#IQRV #comment [Module] ResourceWatcher 浏览时回传文件夹大小

gifur před 4 roky
rodič
revize
b6000774a6

+ 3 - 2
Module/mod_ResourceWatcher/ResourceWatcherFSM.cpp

@@ -1956,6 +1956,7 @@ BOOL ResourceWatcherFSM::InitialDirectoryEntity(LPCTSTR lpszPath, DWORD& dwFileC
     CloseHandle(hFile);
     hFile = NULL;
     m_FileEntry.Current.mAttributes = GetFileAttributesA(lpszPath);
+    m_FileEntry.Current.mFileSize = 0;
 #else
     struct stat st;
 	if (stat(lpszPath, &st) < 0) {
@@ -1974,9 +1975,9 @@ BOOL ResourceWatcherFSM::InitialDirectoryEntity(LPCTSTR lpszPath, DWORD& dwFileC
 		m_FileEntry.Current.mAttributes = FILE_ATTRIBUTE_ARCHIVE;
     if (!(st.st_mode & S_IWUSR))
 		m_FileEntry.Current.mAttributes |= FILE_ATTRIBUTE_READONLY;
+    m_FileEntry.Current.mFileSize = st.st_size;
 #endif //_MSC_VER
-
-	m_FileEntry.Current.mFileSize = 0;
+	
 	DWORD dwDir = 0, dwFile = 0;
 	GetSubFileInfors(&m_FileEntry, dwDir, dwFile, dwFilterAttributes);
 	Dbg("Flag: dwDir:%u, dwFile: %u", dwDir, dwFile);