Represents a filesystem path.
For documentation on individual methods, consult their
counterparts in os.path.
|
|
|
|
|
|
|
|
|
|
|
|
|
statvfs(self)
Perform a statvfs() system call on this path. |
source code
|
|
|
|
|
|
|
link(self,
newpath)
Create a hard link at 'newpath', pointing to this file. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from str :
__contains__ ,
__format__ ,
__ge__ ,
__getattribute__ ,
__getitem__ ,
__getnewargs__ ,
__getslice__ ,
__gt__ ,
__le__ ,
__len__ ,
__lt__ ,
__mod__ ,
__mul__ ,
__new__ ,
__rmod__ ,
__rmul__ ,
__sizeof__ ,
__str__ ,
capitalize ,
center ,
count ,
decode ,
encode ,
endswith ,
expandtabs ,
find ,
format ,
index ,
isalnum ,
isalpha ,
isdigit ,
islower ,
isspace ,
istitle ,
isupper ,
join ,
ljust ,
lower ,
lstrip ,
partition ,
replace ,
rfind ,
rindex ,
rjust ,
rpartition ,
rsplit ,
rstrip ,
split ,
splitlines ,
startswith ,
strip ,
swapcase ,
title ,
translate ,
upper ,
zfill
Inherited from str (private):
_formatter_field_name_split ,
_formatter_parser
Inherited from interface.Interface :
supports
Inherited from object :
__delattr__ ,
__init__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__subclasshook__
|
|
|
|
|
|
|
|
|
|
|
|
__eq__(self,
other)
Comparison method with expanded variables, just to assure
the comparison yields the results we would expect |
source code
|
|
|
|
|
|
|
parent(self)
Returns:
the parent directory of this Path or None if this is the root |
source code
|
|
|
children(self,
predicate=<function <lambda> at 0x7f8b493dc938>,
pattern=None)
Returns:
child paths as retrieved by queryiing the file system. |
source code
|
|
|
isabs(s)
Test whether a path is absolute |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
basename(p)
Returns the final component of a pathname |
|
|
|
expandvars_deep(self)
Expands all environment variables recursively |
source code
|
|
|
expandvars_deep_or_raise(self)
Expands all environment variables recursively, and raises ValueError
if the path still contains variables afterwards |
source code
|
|
|
expand(self)
Clean up a filename by calling expandvars() and expanduser() |
source code
|
|
|
|
|
|
|
namebase(self)
The same as path.basename(), but with one file extension stripped off. |
source code
|
|
|
ext(self)
The file extension, for example '.py'. |
source code
|
|
|
|
Return (p.parent(), p.basename())
|
|
Return (p.drive, <the rest of p>)
|
|
Return (p.stripext(), p.ext)
|
|
Remove one file extension from the path
|
stripext(p)
For example, path('/home/guido/python.tar.gz').stripext()
returns path('/home/guido/python.tar'). |
source code
|
|
|
joinpath(self,
*args)
Join two or more path components, adding a separator
character (os.sep) if needed. |
source code
|
|
|
|
|
relpath(self)
Return this path as a relative path,
originating from the current working directory. |
source code
|
|
|
|
|
relpathfrom(self,
dest)
Return a relative path from dest to self |
source code
|
|
|
|
|
|
|
tonative(self)
Convert the path separator to the type required by the current operating
system - on windows / becomes and on linux becomes / |
source code
|
|
|
|
List of this directory's subdirectories
|
|
List of the files in this directory
|
|
|
walk(self,
pattern=None,
errors=' strict ' ,
predicate=<function <lambda> at 0x7f8b493df9b0>)
create iterator over files and subdirs, recursively. |
source code
|
|
iterator over subdirs, recursively
|
|
iterator over files in D, recursively
|
|
|
fnmatch(self,
pattern)
Return True if self.basename() matches the given pattern. |
source code
|
|
|
glob(self,
pattern)
Return a list of path objects that match the pattern. |
source code
|
|
|
|
|
bytes(self)
Open this file, read all bytes, return them as a string. |
source code
|
|
|
|
|
text(self,
encoding=None,
errors=' strict ' )
Open this file, read it in, return the content as a string. |
source code
|
|
|
write_text(self,
text,
encoding=None,
errors=' strict ' ,
linesep=' \n ' ,
append=False)
Write the given text to this file. |
source code
|
|
|
write_lines(self,
lines,
encoding=None,
errors=' strict ' ,
linesep=' \n ' ,
append=False)
Write the given lines of text to this file. |
source code
|
|
|
lines(self,
encoding=None,
errors=' strict ' ,
retain=True)
Open this file, read all lines, return them in a list. |
source code
|
|
|
digest(self,
hashobject)
Calculate the hash for this file using the given hashobject. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stat(self)
Perform a stat() system call on this path. |
source code
|
|
|
lstat(self)
Like path.stat(), but do not follow symbolic links. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mkdir(self,
mode=511)
Make this directory, fail if it already exists |
source code
|
|
|
|
|
|
|
|
|
touch(self,
flags=65,
mode=438)
Set the access/modified times of this file to the current time. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from interface.iDagItem :
childrenDeep ,
isPartOf ,
isRoot ,
isRootOf ,
parentDeep ,
root
|
Inherited from interface.iDagItem :
iterParents
|
Inherited from interface.iDagItem :
fullChildName
|