diff options
| author | msheby <msheby@cinecert.com> | 2009-06-21 22:22:45 +0000 |
|---|---|---|
| committer | msheby <> | 2009-06-21 22:22:45 +0000 |
| commit | e34beed6313ea4add7539608ecb92082728778f1 (patch) | |
| tree | 313719d479b70b62134eeaa1b3c05ca090bfb34d /src/KM_fileio.cpp | |
| parent | 019da2c07073b55ffba7f939fd1ecb9c17016a11 (diff) | |
Add extra include for OpenBSD and OSX.
Diffstat (limited to 'src/KM_fileio.cpp')
| -rw-r--r-- | src/KM_fileio.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/KM_fileio.cpp b/src/KM_fileio.cpp index d00031c..9808cfd 100644 --- a/src/KM_fileio.cpp +++ b/src/KM_fileio.cpp @@ -57,6 +57,7 @@ struct iovec { # if defined(__linux__) # include <sys/statfs.h> # else +# include <sys/param.h> # include <sys/mount.h> # endif @@ -1504,17 +1505,17 @@ Kumu::DeletePath(const std::string& pathname) Result_t Kumu::FreeSpaceForPath(const std::string& path, Kumu::fsize_t& free_space, Kumu::fsize_t& total_space) -{
+{ #ifdef KM_WIN32 - ULARGE_INTEGER lTotalNumberOfBytes;
+ ULARGE_INTEGER lTotalNumberOfBytes; ULARGE_INTEGER lTotalNumberOfFreeBytes; BOOL fResult = ::GetDiskFreeSpaceEx(path.c_str(), NULL, &lTotalNumberOfBytes, &lTotalNumberOfFreeBytes); - if (fResult) {
+ if (fResult) { free_space = static_cast<Kumu::fsize_t>(lTotalNumberOfFreeBytes.QuadPart); total_space = static_cast<Kumu::fsize_t>(lTotalNumberOfBytes.QuadPart); return RESULT_OK; - }
+ } HRESULT LastError = ::GetLastError(); DefaultLogSink().Error("FreeSpaceForPath GetDiskFreeSpaceEx %s: %lu\n", path.c_str(), ::GetLastError()); |
