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 |
Returns the bytes in the file. |
Method | read |
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 |
Writes the given `bytes` to the file. |
Method | write |
Writes the given `text` to the file. |
Property | parent |
The name of the directory the file or directory is in. |
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:str | Undocumented |
symlinks:bool | Undocumented |
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:str | Undocumented |
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 | |
ignorebool | Undocumented |
onerror:Callable|None | Undocumented |