Orbits  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
Classes | Functions | Variables
posixpath Namespace Reference

Classes

class  _unicode
 

Functions

def normcase
 
def isabs
 
def join
 
def split
 
def splitext
 
def splitdrive
 
def basename
 
def dirname
 
def islink
 
def lexists
 
def samefile
 
def sameopenfile
 
def samestat
 
def ismount
 
def walk
 
def expanduser
 
def expandvars
 
def normpath
 
def abspath
 
def realpath
 
def _joinrealpath
 
def relpath
 

Variables

 _unicode = unicode
 
list __all__
 
string curdir = '.'
 
string pardir = '..'
 
string extsep = '.'
 
string sep = '/'
 
string pathsep = ':'
 
string defpath = ':/bin:/usr/bin'
 
 altsep = None
 
string devnull = '/dev/null'
 
 _varprog = None
 
tuple supports_unicode_filenames = (sys.platform == 'darwin')
 

Detailed Description

Common operations on Posix pathnames.

Instead of importing this module directly, import os and refer to
this module as os.path.  The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. macpath, ntpath).

Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.

Function Documentation

def posixpath._joinrealpath (   path,
  rest,
  seen 
)
private
def posixpath.abspath (   path)
Return an absolute path.
def posixpath.basename (   p)
Returns the final component of a pathname
def posixpath.dirname (   p)
Returns the directory component of a pathname
def posixpath.expanduser (   path)
Expand ~ and ~user constructions.  If user or $HOME is unknown,
do nothing.
def posixpath.expandvars (   path)
Expand shell variables of form $var and ${var}.  Unknown variables
are left unchanged.
def posixpath.isabs (   s)
Test whether a path is absolute
def posixpath.islink (   path)
Test whether a path is a symbolic link
def posixpath.ismount (   path)
Test whether a path is a mount point
def posixpath.join (   a,
  p 
)
Join two or more pathname components, inserting '/' as needed.
If any component is an absolute path, all previous path components
will be discarded.  An empty last part will result in a path that
ends with a separator.
def posixpath.lexists (   path)
Test whether a path exists.  Returns True for broken symbolic links
def posixpath.normcase (   s)
Normalize case of pathname.  Has no effect under Posix
def posixpath.normpath (   path)
Normalize path, eliminating double slashes, etc.
def posixpath.realpath (   filename)
Return the canonical path of the specified filename, eliminating any
symbolic links encountered in the path.
def posixpath.relpath (   path,
  start = curdir 
)
Return a relative version of a path
def posixpath.samefile (   f1,
  f2 
)
Test whether two pathnames reference the same actual file
def posixpath.sameopenfile (   fp1,
  fp2 
)
Test whether two open file objects reference the same file
def posixpath.samestat (   s1,
  s2 
)
Test whether two stat buffers reference the same file
def posixpath.split (   p)
Split a pathname.  Returns tuple "(head, tail)" where "tail" is
everything after the final slash.  Either part may be empty.
def posixpath.splitdrive (   p)
Split a pathname into drive and path. On Posix, drive is always
empty.
def posixpath.splitext (   p)
def posixpath.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.

Variable Documentation

list posixpath.__all__
Initial value:
1 = ["normcase","isabs","join","splitdrive","split","splitext",
2  "basename","dirname","commonprefix","getsize","getmtime",
3  "getatime","getctime","islink","exists","lexists","isdir","isfile",
4  "ismount","walk","expanduser","expandvars","normpath","abspath",
5  "samefile","sameopenfile","samestat",
6  "curdir","pardir","sep","pathsep","defpath","altsep","extsep",
7  "devnull","realpath","supports_unicode_filenames","relpath"]
posixpath._unicode = unicode
posixpath._varprog = None
posixpath.altsep = None
string posixpath.curdir = '.'
string posixpath.defpath = ':/bin:/usr/bin'
string posixpath.devnull = '/dev/null'
string posixpath.extsep = '.'
string posixpath.pardir = '..'
string posixpath.pathsep = ':'
string posixpath.sep = '/'
tuple posixpath.supports_unicode_filenames = (sys.platform == 'darwin')

Copyright 2014 Google Inc. All rights reserved.