ntpath
index
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ntpath.py
Module Docs

Common pathname manipulations, WindowsNT/95 version.
 
Instead of importing this module directly, import os and refer to this
module as os.path.

 
Modules
       
genericpath
os
stat
sys
warnings

 
Functions
       
abspath(path)
Return the absolute version of a path.
basename(p)
Returns the final component of a pathname
commonprefix(m)
Given a list of pathnames, returns the longest common leading component
dirname(p)
Returns the directory component of a pathname
exists(path)
Test whether a path exists.  Returns False for broken symbolic links
expanduser(path)
Expand ~ and ~user constructs.
 
If user or $HOME is unknown, do nothing.
expandvars(path)
Expand shell variables of the forms $var, ${var} and %var%.
 
Unknown variables are left unchanged.
getatime(filename)
Return the last access time of a file, reported by os.stat().
getctime(filename)
Return the metadata change time of a file, reported by os.stat().
getmtime(filename)
Return the last modification time of a file, reported by os.stat().
getsize(filename)
Return the size of a file, reported by os.stat().
isabs(s)
Test whether a path is absolute
isdir(s)
Return true if the pathname refers to an existing directory.
isfile(path)
Test whether a path is a regular file
islink(path)
Test for symbolic link.
On WindowsNT/95 and OS/2 always returns false
ismount(path)
Test whether a path is a mount point (defined as root of drive)
join(path, *paths)
Join two or more pathname components, inserting "\" as needed.
lexists = exists(path)
Test whether a path exists.  Returns False for broken symbolic links
normcase(s)
Normalize case of pathname.
 
Makes all characters lowercase and all slashes into backslashes.
normpath(path)
Normalize path, eliminating double slashes, etc.
realpath = abspath(path)
Return the absolute version of a path.
relpath(path, start='.')
Return a relative version of a path
split(p)
Split a pathname.
 
Return tuple (head, tail) where tail is everything after the final slash.
Either part may be empty.
splitdrive(p)
Split a pathname into drive/UNC sharepoint and relative path specifiers.
Returns a 2-tuple (drive_or_unc, path); either part may be empty.
 
If you assign
    result = splitdrive(p)
It is always true that:
    result[0] + result[1] == p
 
If the path contained a drive letter, drive_or_unc will contain everything
up to and including the colon.  e.g. splitdrive("c:/dir") returns ("c:", "/dir")
 
If the path contained a UNC path, the drive_or_unc will contain the host name
and share up to but not including the fourth directory separator character.
e.g. splitdrive("//host/computer/dir") returns ("//host/computer", "/dir")
 
Paths cannot contain both a drive letter and a UNC path.
splitext(p)
Split the extension from a pathname.
 
Extension is everything from the last dot to the end, ignoring
leading dots.  Returns "(root, ext)"; ext may be empty.
splitunc(p)
Split a pathname into UNC mount point and relative path specifiers.
 
Return a 2-tuple (unc, rest); either part may be empty.
If unc is not empty, it has the form '//host/mount' (or similar
using backslashes).  unc+rest is always the input path.
Paths containing drive letters never have an UNC part.
walk(top, func, arg)
Directory tree walk with callback function.
 
For each directory in the directory tree rooted at top (including top
itself, but excluding '.' and '..'), call func(arg, dirname, fnames).
dirname is the name of the directory, and fnames a list of the names of
the files and subdirectories in dirname (excluding '.' and '..').  func
may modify the fnames list in-place (e.g. via del or slice assignment),
and walk will only recurse into the subdirectories whose names remain in
fnames; this can be used to implement a filter, or to impose a specific
order of visiting.  No semantics are defined for, or required of, arg,
beyond that arg is always passed to func.  It can be used, e.g., to pass
a filename pattern, or a mutable object designed to accumulate
statistics.  Passing None for arg is common.

 
Data
        __all__ = ['normcase', 'isabs', 'join', 'splitdrive', 'split', 'splitext', 'basename', 'dirname', 'commonprefix', 'getsize', 'getmtime', 'getatime', 'getctime', 'islink', 'exists', 'lexists', 'isdir', 'isfile', 'ismount', 'walk', ...]
altsep = '/'
curdir = '.'
defpath = r'.;C:\bin'
devnull = 'nul'
extsep = '.'
pardir = '..'
pathsep = ';'
sep = r'\'
supports_unicode_filenames = False