views:

270

answers:

3

i am reading svn contents using GetList method of svnClient class, i want to know how can i determine the full size of directory including sub directories, i can read the size using FileSize property of SvnListEventArgs.

+2  A: 

You have to do it recursively. Scan each directory, add up all the sizes of files in that directory plus the sizes of each subdirectory. Your function should recurse until a particular directory has no more subdirectories.

Michael Hackner
yes, but i am looking for a direct method as each directory contains massive data, and i need the size over and over. Recursion will be costly.
Shahbaz
A: 

I have the same problem than you Shahbaz. It takes several minutes to traverse directories and subdirectories to find the total size of the repository. Have you found any solution?

Jesús
I checked out repository to working directory, then traversed locally to calculate the size, it solved my problem.
Shahbaz
A: 

I generated a code that consults the entire contents of a repository (400 files) to estimate its size. This takes about two minutes:

/ / This is the line of code that spends nearly two-minute process
client.GetPropertyList (targetSource, args, out proplist)

/ / Only interested me the size of each of the files in folders and subfolders of the repository

Does anyone know a way to do the process more fast?

I have also noticed that omitted text files (.txt).

Someone knows what be caused this fail?

Thanks in advance!!

Jesús