[tahoe-dev] [tahoe-lafs] #637: support "keep this much disk space free" on Windows as well as other platforms

tahoe-lafs trac at allmydata.org
Sun Oct 25 17:39:08 UTC 2009


#637: support "keep this much disk space free" on Windows as well as other
platforms
--------------------------+-------------------------------------------------
 Reporter:  zooko         |           Owner:  zooko     
     Type:  defect        |          Status:  assigned  
 Priority:  major         |       Milestone:  eventually
Component:  code-storage  |         Version:  1.3.0     
 Keywords:  win32 easy    |   Launchpad_bug:            
--------------------------+-------------------------------------------------
Changes (by zooko):

  * keywords:  win32 => win32 easy
  * milestone:  1.6.0 => eventually


Old description:

> This patch [20090220220353-4233b-
> 24ec3c21004366dbb38ac28ec1fccce44f693b7b] 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 2^32 bytes:
> http://msdn.microsoft.com/en-us/library/aa364935.aspx

New description:

 This patch [20090220220353-4233b-24ec3c21004366dbb38ac28ec1fccce44f693b7b]
 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 2^32^ bytes:
 http://msdn.microsoft.com/en-us/library/aa364935.aspx

--

Comment:

 Any Windows hackers want to fix this?  It really bothers me to see Windows
 getting second-class-citizen treatment, but I don't have convenient access
 to a Windows box right now to work on, and I'm prioritizing testing,
 packaging, and release-management for the imminent Tahoe-LAFS v1.6
 release.

 It really should be pretty easy.  In fact, I'm marking it with the "easy"
 tag.

-- 
Ticket URL: <http://allmydata.org/trac/tahoe/ticket/637#comment:2>
tahoe-lafs <http://allmydata.org>
secure decentralized file storage grid


More information about the tahoe-dev mailing list