Skip to content
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

disk_usage(path) confusion #999

Closed
MrBillium opened this issue Mar 24, 2017 · 1 comment
Closed

disk_usage(path) confusion #999

MrBillium opened this issue Mar 24, 2017 · 1 comment
Labels

Comments

@MrBillium
Copy link

It appears that disk_usage (path) does not report the size of the directory tree in the specified path but instead reports the size of the partition | mountpoint that contains the path.

This is not what I expected and the current documentation does not describe this behavior:

psutil.disk_usage(path)[source]
Return disk usage statistics about the given path as a named tuple including total, used and free space expressed in bytes, plus the percentage usage. OSError is raised if path does not exist.

I suggest updating the documentation to make it clear that you do not get the disk used by the 'path'.
Better still, modify code to actually report the disk used by the path - like du command

Bill

giampaolo added a commit that referenced this issue Mar 24, 2017
@giampaolo
Copy link
Owner

OK, changed to:

Return disk usage statistics about the partition which contains the given
path as a named tuple including total, used and free space
expressed in bytes, plus the percentage usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants