diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-18 12:34:24 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-18 12:34:24 +0000 |
commit | 0e91dd2a1cec40c6fa0390c890e10dc75398de34 (patch) | |
tree | f4385248c0abb048ec718cb555b5287847bc4429 /base/sys_info_win.cc | |
parent | fadf97f2f16f6b3ad2756cd07657c4f47172da92 (diff) | |
download | chromium_src-0e91dd2a1cec40c6fa0390c890e10dc75398de34.zip chromium_src-0e91dd2a1cec40c6fa0390c890e10dc75398de34.tar.gz chromium_src-0e91dd2a1cec40c6fa0390c890e10dc75398de34.tar.bz2 |
Move GetFreeDiskSpace to SysInfo.
Patch from Pawel Hajdan Jr.
Review URL: http://codereview.chromium.org/3141
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/sys_info_win.cc')
-rw-r--r-- | base/sys_info_win.cc | 9 |
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 |