# pydoc > ntpath

---
type: CommandReference
command: ntpath
mode: pydoc
section: ""
source: pydoc3
---

## Quick Reference

- `os.path.abspath(path)` — return absolute path
- `os.path.basename(path)` — final component of a path
- `os.path.dirname(path)` — directory component of a path
- `os.path.join(path, *paths)` — join two or more paths
- `os.path.normpath(path)` — normalize path (eliminate double slashes, etc.)
- `os.path.exists(path)` — test if path exists (False for broken symlinks)
- `os.path.isfile(path)` — test if path is a regular file
- `os.path.isdir(path)` — test if path is a directory
- `os.path.split(path)` — split into (head, tail)
- `os.path.splitext(path)` — split into (root, ext)

## Name

ntpath — Common pathname manipulations, WindowsNT/95 version.

## Synopsis

Import `os` and use `os.path` functions. This module is the Windows-specific implementation of `os.path`.

python
import os
os.path.join('C:', 'Users', 'Public')
## Functions

- `abspath(path)` — return absolute version of a path (fallback if `nt._getfullpathname` unavailable)
- `basename(path)` — returns the final component of a pathname
- `commonpath(paths)` — given a sequence of path names, returns the longest common sub-path
- `commonprefix(list)` — given a list of pathnames, returns the longest common leading component
- `dirname(path)` — 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 `$var`, `${var}`, `%var%`; unknown variables left unchanged
- `getatime(path)` — return last access time of a file, reported by `os.stat()`
- `getctime(path)` — return metadata change time of a file, reported by `os.stat()`
- `getmtime(path)` — return last modification time of a file, reported by `os.stat()`
- `getsize(path)` — return size of a file, reported by `os.stat()`
- `isabs(path)` — test whether a path is absolute
- `isdir(path)` — return true if the pathname refers to an existing directory
- `isfile(path)` — test whether a path is a regular file
- `islink(path)` — test whether a path is a symbolic link; always returns False for Windows prior to 6.0
- `ismount(path)` — test whether a path is a mount point (drive root, share root, or mounted volume)
- `join(path, *paths)` — join two or more paths
- `lexists(path)` — test whether a path exists; returns True for broken symbolic links
- `normcase(path)` — normalize case of pathname (lowercase, all slashes to backslashes)
- `normpath(path)` — normalize path, eliminating double slashes, etc.
- `realpath(path)` — alias for `abspath` (fallback)
- `relpath(path, start=os.curdir)` — return a relative version of a path
- `samefile(path1, path2)` — test whether two pathnames reference the same file/directory (by device and i-node)
- `sameopenfile(fp1, fp2)` — test whether two open file objects reference the same file
- `samestat(stat1, stat2)` — test whether two stat buffers reference the same file
- `split(path)` — split a pathname into (head, tail); tail is everything after the final slash
- `splitdrive(path)` — split into (drive_or_unc, path); e.g. `splitdrive("c:/dir")` returns `("c:", "/dir")`
- `splitext(path)` — split extension from pathname; returns `(root, ext)`; extension is everything after the last dot, ignoring leading dots

## Data

- `__all__` — list of public names: `['normcase', 'isabs', 'join', 'splitdrive', 'split', 'splitext', ...]`
- `altsep = '/'` — alternative separator
- `curdir = '.'` — current directory string
- `defpath = r'.;C:\bin'` — default search path
- `devnull = 'nul'` — null device
- `extsep = '.'` — extension separator
- `pardir = '..'` — parent directory string
- `pathsep = ';'` — path separator
- `sep = r'\'` — path separator
- `supports_unicode_filenames = False` — whether the filesystem supports Unicode filenames

## See Also

- [Python os.path module documentation](https://docs.python.org/3.10/library/os.path.html)
- [ntpath source](https://docs.python.org/3.10/library/ntpath.html)