Opened at 2009-02-22T03:47:18Z
Last modified at 2010-02-02T05:51:37Z
#637 closed defect
support "keep this much disk space free" on Windows as well as other platforms — at Initial Version
Reported by: | zooko | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.6.0 |
Component: | code-storage | Version: | 1.3.0 |
Keywords: | win32 easy reviewed news-done | Cc: | tahoe-dev@…, kevan@… |
Launchpad Bug: |
Description
This patch 2e45619844cb7c36 makes it so that if we don't know how to find out the free disk space on a platform, we fall back gracefully by display something like "I dunno" instead of the free disk space. We also already have code (before that patch) which falls back gracefully in the sense of emitting a warning at startup if the reserved_space feature has been configured (see [src:doc/configuration.txt]) and the current platform can't figure out how much free disk space it has.
However, rather than having such fallbacks, I would really rather just ensure that Tahoe figures out how much free disk space it has on all supported platforms. For Windows (the only platform which currently does work using statvfs), the way to do that is to require pywin32, import win32api, and call win32api.GetDiskFreeSpaceEx()
http://docs.activestate.com/activepython/2.5/pywin32/win32api__GetDiskFreeSpaceEx_meth.html http://msdn.microsoft.com/en-us/library/aa364937(VS.85).aspx
Careful, don't call win32api.GetDiskFreeSpace() -- that's an old function that predates disks with more than 232 bytes: http://msdn.microsoft.com/en-us/library/aa364935.aspx