Popular recipes tagged "space"http://code.activestate.com/recipes/tags/space/2012-10-06T15:33:40-07:00ActiveState Code RecipesDisk usage (Python)
2012-10-06T15:33:40-07:00Giampaolo RodolĂ http://code.activestate.com/recipes/users/4178764/http://code.activestate.com/recipes/577972-disk-usage/
<p style="color: grey">
Python
recipe 577972
by <a href="/recipes/users/4178764/">Giampaolo RodolĂ </a>
(<a href="/recipes/tags/disk/">disk</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/python3/">python3</a>, <a href="/recipes/tags/space/">space</a>, <a href="/recipes/tags/statistics/">statistics</a>, <a href="/recipes/tags/usage/">usage</a>).
Revision 6.
</p>
<p>Provides disk usage statistics (total, used and free disk space) about a given path.</p>
<p>This recipe was initially developed for psutil:</p>
<ul>
<li><a href="http://code.google.com/p/psutil/issues/detail?id=172" rel="nofollow">http://code.google.com/p/psutil/issues/detail?id=172</a></li>
</ul>
<p>...and then included into shutil module starting from Python 3.3:</p>
<ul>
<li><a href="http://mail.python.org/pipermail/python-ideas/2011-June/010480.html" rel="nofollow">http://mail.python.org/pipermail/python-ideas/2011-June/010480.html</a></li>
<li><a href="http://bugs.python.org/issue12442" rel="nofollow">http://bugs.python.org/issue12442</a></li>
<li><a href="http://docs.python.org/dev/library/shutil.html#shutil.disk_usage" rel="nofollow">http://docs.python.org/dev/library/shutil.html#shutil.disk_usage</a></li>
</ul>
<p>The recipe you see here is a modified version of the latter one in that the Windows implementation uses ctypes instead of a C extension module. As such it can be used with python >= 2.5.</p>