Calculate Folder size
-
Hello Can anyone tell me how to calulate number of bytes on the disk for given folder?(Folder size)
-
Hello Can anyone tell me how to calulate number of bytes on the disk for given folder?(Folder size)
-
Hello Can anyone tell me how to calulate number of bytes on the disk for given folder?(Folder size)
As far as i know there is no API for that I did need the same thing what I did was I created a recursive function enumerated all the file and added their size. Ex BOOL GetFolderSize(TCHAR* szRoot,__int64* i64Size) { FindFirstFile(...); do{ //IF FOLDER GetFolderSize( szSubPath,i64Size) //ELSE IF FILE Add its value }while(FindNextFile(hFind,&FindFileData)); FindClose(...); return(TRUE) } but keep in mind that the FindFile.. returns 2 unneeded values the "." and ".." that you should ignore otherwise you will enumerate forever i think
G_S
-
As far as i know there is no API for that I did need the same thing what I did was I created a recursive function enumerated all the file and added their size. Ex BOOL GetFolderSize(TCHAR* szRoot,__int64* i64Size) { FindFirstFile(...); do{ //IF FOLDER GetFolderSize( szSubPath,i64Size) //ELSE IF FILE Add its value }while(FindNextFile(hFind,&FindFileData)); FindClose(...); return(TRUE) } but keep in mind that the FindFile.. returns 2 unneeded values the "." and ".." that you should ignore otherwise you will enumerate forever i think
G_S
thanx