diff options
| author | Giampaolo Rodola' <g.rodola@gmail.com> | 2011-07-01 13:55:36 +0200 |
|---|---|---|
| committer | Giampaolo Rodola' <g.rodola@gmail.com> | 2011-07-01 13:55:36 +0200 |
| commit | 5db762da1622b0dc700b57911f6ffaf32b124d80 (patch) | |
| tree | 5f4fccacb78296d408ddf63d9875497548506ce8 /Doc | |
| parent | 9eb189829f51d08c92e61c58551b018647d12bd2 (diff) | |
| download | cpython-5db762da1622b0dc700b57911f6ffaf32b124d80.tar.gz | |
Issue #12442: add shutil.disk_usage()
Diffstat (limited to 'Doc')
| -rw-r--r-- | Doc/library/shutil.rst | 8 | ||||
| -rw-r--r-- | Doc/whatsnew/3.3.rst | 11 |
2 files changed, 18 insertions, 1 deletions
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 1a878d5fd0..88c0eaa8db 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -164,6 +164,14 @@ Directory and files operations If the destination is on the current filesystem, then simply use rename. Otherwise, copy src (with :func:`copy2`) to the dst and then remove src. +.. function:: disk_usage(path) + + Return disk usage statistics about the given path as a namedtuple including + total, used and free space expressed in bytes. + + .. versionadded:: 3.3 + + Availability: Unix, Windows. .. exception:: Error diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst index 63f8b155c8..a2f512b8bc 100644 --- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -200,7 +200,16 @@ The :class:`~ftplib.FTP_TLS` class now provides a new plaintex. This can be useful to take advantage of firewalls that know how to handle NAT with non-secure FTP without opening fixed ports. -(Patch submitted by Giampaolo Rodolà in :issue:`12139`.) +(Contributed by Giampaolo Rodolà in :issue:`12139`) + + +shutil +------ + +The :mod:`shutil` module has a new :func:`~shutil.disk_usage` providing total, +used and free disk space statistics. + +(Contributed by Giampaolo Rodolà in :issue:`12442`) Optimizations |
