summaryrefslogtreecommitdiffstats
path: root/base/sys_info_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/sys_info_win.cc')
-rw-r--r--base/sys_info_win.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/base/sys_info_win.cc b/base/sys_info_win.cc
index 8b6dfea..a90f7b9 100644
--- a/base/sys_info_win.cc
+++ b/base/sys_info_win.cc
@@ -29,4 +29,13 @@ int64 SysInfo::AmountOfPhysicalMemory() {
return static_cast<int64>(memory_info.ullTotalPhys);
}
+// static
+int64 SysInfo::AmountOfFreeDiskSpace(const std::wstring& path) {
+ ULARGE_INTEGER available, total, free;
+ if (!GetDiskFreeSpaceExW(path.c_str(), &available, &total, &free)) {
+ return 0;
+ }
+ return static_cast<int64>(available.QuadPart);
+}
+
} // namespace base