-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shutil.disk_usage() #56651
Comments
Patch in attachment adds a new disk_usage() function to shutil module which retrieves total, used and free disk space given a certain path plus the percentage usage. See original discussion on python-ideas ml: |
New patch includes:
|
Why do you return a percentage? People can compute that themselves if they want to. |
Agreed. I think we should pass on the raw data - how the user wants to format and present that is up to them. |
Agreed. free = st.f_bavail * st.f_bsize
total = st.f_blocks * st.f_frsize
used = (total - st.f_bfree * st.f_bsize) |
New changeset 2fc102ebaf73 by Giampaolo Rodola' in branch 'default': |
Looks like my message on Rietveld was not received or not read: http://bugs.python.org/review/12442/diff/2951/7664#newcode776 |
I removed the percent usage from the returned namedtuple hence that comment is no longer necessary. |
Ah, excellent! Thanks for the new function. About using assertGreater and friends in tests, as Ezio and I suggested, I have done the change in my working copy and will commit it later. |
New changeset 479973c6aa03 by Éric Araujo in branch 'default': |
Thanks for the further fixes. |
New changeset bdb3f0e7e268 by Victor Stinner in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: