Index: base/file_util.cc |
=================================================================== |
--- base/file_util.cc (revision 42362) |
+++ base/file_util.cc (working copy) |
@@ -268,6 +268,23 @@ |
return true; |
} |
+int64 ComputeDirectorySize(const FilePath& root_path) { |
+ int64 running_size = 0; |
+ FileEnumerator file_iter(root_path, true, FileEnumerator::FILES); |
+ for (FilePath current = file_iter.Next(); !current.empty(); |
+ current = file_iter.Next()) { |
+ FileEnumerator::FindInfo info; |
+ file_iter.GetFindInfo(&info); |
+#if defined(OS_WIN) |
+ LARGE_INTEGER li = { info.nFileSizeLow, info.nFileSizeHigh }; |
+ running_size += li.QuadPart; |
+#else |
+ running_size += info.stat.st_size; |
+#endif |
+ } |
+ return running_size; |
+} |
+ |
/////////////////////////////////////////////// |
// MemoryMappedFile |