summaryrefslogtreecommitdiffstats
path: root/Doc/library/os.path.rst
diff options
context:
space:
mode:
authorMark Hammond <mhammond@skippinet.com.au>2009-05-06 08:04:54 (GMT)
committerMark Hammond <mhammond@skippinet.com.au>2009-05-06 08:04:54 (GMT)
commit5a607a3ee5e81bdcef3f886f9d20c1376a533df4 (patch)
tree8f345de07eede5253b7507a925973bd2b8c1cdbb /Doc/library/os.path.rst
parent9348901e24da507d5e8c68b8bad8b9b2827a4596 (diff)
downloadcpython-5a607a3ee5e81bdcef3f886f9d20c1376a533df4.zip
cpython-5a607a3ee5e81bdcef3f886f9d20c1376a533df4.tar.gz
cpython-5a607a3ee5e81bdcef3f886f9d20c1376a533df4.tar.bz2
Issue #5799: ntpath (ie, os.path on Windows) fully supports UNC pathnames.
By Larry Hastings, reviewed eric.smith and mark.hammond.
Diffstat (limited to 'Doc/library/os.path.rst')
-rw-r--r--Doc/library/os.path.rst19
1 files changed, 14 insertions, 5 deletions
diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst
index c85412e..6d177f8 100644
--- a/Doc/library/os.path.rst
+++ b/Doc/library/os.path.rst
@@ -23,10 +23,6 @@ applications should use string objects to access all files.
their parameters. The result is an object of the same type, if a path or
file name is returned.
-.. note::
-
- On Windows, many of these functions do not properly support UNC pathnames.
- :func:`splitunc` and :func:`ismount` do handle them correctly.
.. note::
@@ -266,10 +262,20 @@ applications should use string objects to access all files.
.. function:: splitdrive(path)
Split the pathname *path* into a pair ``(drive, tail)`` where *drive* is either
- a drive specification or the empty string. On systems which do not use drive
+ a mount point or the empty string. On systems which do not use drive
specifications, *drive* will always be the empty string. In all cases, ``drive
+ tail`` will be the same as *path*.
+ On Windows, splits a pathname into drive/UNC sharepoint and relative path.
+
+ If the path contains a drive letter, drive will contain everything
+ up to and including the colon.
+ e.g. ``splitdrive("c:/dir")`` returns ``("c:", "/dir")``
+
+ If the path contains a UNC path, drive will contain the host name
+ and share, up to but not including the fourth separator.
+ e.g. ``splitdrive("//host/computer/dir")`` returns ``("//host/computer", "/dir")``
+
.. function:: splitext(path)
@@ -281,6 +287,9 @@ applications should use string objects to access all files.
.. function:: splitunc(path)
+ .. deprecated:: 3.1
+ Use *splitdrive* instead.
+
Split the pathname *path* into a pair ``(unc, rest)`` so that *unc* is the UNC
mount point (such as ``r'\\host\mount'``), if present, and *rest* the rest of
the path (such as ``r'\path\file.ext'``). For paths containing drive letters,