class documentation

Represents a path which behaves like a string.

Method __repr__ Undocumented
Method abspath Returns the absolute path.
Method basename Undocumented
Method copytree Recursively copy a directory to the given `destination`. If the given `destination` does not exist it will be created.
Method exists Returns ``True`` if the path exist.
Method isabs Returns ``True`` if the path is absolute.
Method isdir Returns ``True`` if the path is a directory.
Method isfile Returns ``True`` if the path is a file.
Method islink Returns ``True`` if the path is a symbolic link.
Method ismount Returns ``True`` if the path is a mount point.
Method joinpath Joins the path with the argument given and returns the result.
Method lexists Returns ``True`` if the path exists unless it is a broken symbolic link.
Method listdir Undocumented
Method makedirs Recursively create directories.
Method movetree Recursively move the file or directory to the given `destination` similar to the Unix "mv" command.
Method open Undocumented
Method read_bytes Returns the bytes in the file.
Method read_text Returns the text in the file.
Method rmtree Removes the file or directory and any files or directories it may contain.
Method stat Returns a stat of the file.
Method unlink Removes a file.
Method utime Undocumented
Method write_bytes Writes the given `bytes` to the file.
Method write_text Writes the given `text` to the file.
Property parent The name of the directory the file or directory is in.
def __repr__(self): (source)

Undocumented

Returns
strUndocumented
def abspath(self): (source)

Returns the absolute path.

Returns
pathUndocumented
def basename(self): (source)

Undocumented

Returns
strUndocumented
def copytree(self, destination, symlinks=False): (source)

Recursively copy a directory to the given `destination`. If the given `destination` does not exist it will be created. :param symlinks: If ``True`` symbolic links in the source tree result in symbolic links in the destination tree otherwise the contents of the files pointed to by the symbolic links are copied.

Parameters
destination:strUndocumented
symlinks:boolUndocumented
def exists(self): (source)

Returns ``True`` if the path exist.

Returns
boolUndocumented
def isabs(self): (source)

Returns ``True`` if the path is absolute.

Returns
boolUndocumented
def isdir(self): (source)

Returns ``True`` if the path is a directory.

Returns
boolUndocumented
def isfile(self): (source)

Returns ``True`` if the path is a file.

Returns
boolUndocumented
def islink(self): (source)

Returns ``True`` if the path is a symbolic link.

Returns
boolUndocumented
def ismount(self): (source)

Returns ``True`` if the path is a mount point.

Returns
boolUndocumented
def joinpath(self, *args): (source)

Joins the path with the argument given and returns the result.

Parameters
*args:AnyUndocumented
Returns
pathUndocumented
def lexists(self): (source)

Returns ``True`` if the path exists unless it is a broken symbolic link.

Returns
boolUndocumented
def listdir(self): (source)

Undocumented

Returns
list[str]Undocumented
def makedirs(self, mode=511, exist_ok=False): (source)

Recursively create directories.

Parameters
mode:intUndocumented
exist_ok:boolUndocumented
def movetree(self, destination): (source)

Recursively move the file or directory to the given `destination` similar to the Unix "mv" command. If the `destination` is a file it may be overwritten depending on the :func:`os.rename` semantics.

Parameters
destination:strUndocumented
def open(self, mode='r', **kwargs): (source)

Undocumented

Parameters
mode:strUndocumented
**kwargs:AnyUndocumented
Returns
IOUndocumented
def read_bytes(self): (source)

Returns the bytes in the file.

Returns
builtins.bytesUndocumented
def read_text(self, encoding='utf-8', **kwargs): (source)

Returns the text in the file.

Parameters
encoding:strUndocumented
**kwargs:AnyUndocumented
Returns
strUndocumented
def rmtree(self, ignore_errors=False, onerror=None): (source)

Removes the file or directory and any files or directories it may contain. :param ignore_errors: If ``True`` errors are silently ignored, otherwise an exception is raised in case an error occurs. :param onerror: A callback which gets called with the arguments `func`, `path` and `exc_info`. `func` is one of :func:`os.listdir`, :func:`os.remove` or :func:`os.rmdir`. `path` is the argument to the function which caused it to fail and `exc_info` is a tuple as returned by :func:`sys.exc_info`.

Parameters
ignore_errors:boolUndocumented
onerror:Callable|NoneUndocumented
def stat(self): (source)

Returns a stat of the file.

Returns
AnyUndocumented
def unlink(self): (source)

Removes a file.

def utime(self, arg): (source)

Undocumented

Parameters
arg:AnyUndocumented
def write_bytes(self, bytes, append=False): (source)

Writes the given `bytes` to the file. :param append: If ``True`` given `bytes` are added at the end of the file.

Parameters
bytes:strUndocumented
append:boolUndocumented
def write_text(self, text, encoding='utf-8', **kwargs): (source)

Writes the given `text` to the file.

Parameters
text:strUndocumented
encoding:strUndocumented
**kwargs:AnyUndocumented

The name of the directory the file or directory is in.