diff options
author | Giampaolo Rodola' <g.rodola@gmail.com> | 2011-07-01 11:55:36 (GMT) |
---|---|---|
committer | Giampaolo Rodola' <g.rodola@gmail.com> | 2011-07-01 11:55:36 (GMT) |
commit | 210e7ca032d51b8368359c02ad505dbd5f633cc9 (patch) | |
tree | 6558f76ed9be7add62a771d5b09b52e94f058fa3 /Doc | |
parent | 59929d9877e2968c38e672f14cd92aa63bfe9c4b (diff) | |
download | cpython-210e7ca032d51b8368359c02ad505dbd5f633cc9.zip cpython-210e7ca032d51b8368359c02ad505dbd5f633cc9.tar.gz cpython-210e7ca032d51b8368359c02ad505dbd5f633cc9.tar.bz2 |
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 1a878d5..88c0eaa 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 63f8b15..a2f512b 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 |