binaryninja.scriptingprovider.PurePath

class PurePath(*args)[source]

Base class for manipulating paths without I/O.

PurePath represents a filesystem path and offers operations which don’t imply any actual filesystem I/O. Depending on your system, instantiating a PurePath will return either a PurePosixPath or a PureWindowsPath object. You can also instantiate either of these classes directly, regardless of your system.

__init__()

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__()

Initialize self.

as_posix()

Return the string representation of the path with forward (/) slashes.

as_uri()

Return the path as a ‘file’ URI.

is_absolute()

True if the path is absolute (has both a root and, if applicable, a drive).

is_reserved()

Return True if the path contains one of the special names reserved by the system, if any.

joinpath(*args)

Combine this path with one or several arguments, and return a new path representing either a subpath (if all arguments are relative paths) or a totally different path (if one of the arguments is anchored).

match(path_pattern)

Return True if this path matches the given pattern.

relative_to(*other)

Return the relative path to another path identified by the passed arguments.

with_name(name)

Return a new path with the file name changed.

with_suffix(suffix)

Return a new path with the file suffix changed.

Attributes

anchor

The concatenation of the drive and root, or ‘’.

drive

The drive prefix (letter or UNC path), if any.

name

The final path component, if any.

parent

The logical parent of the path.

parents

A sequence of this path’s logical parents.

parts

An object providing sequence-like access to the components in the filesystem path.

root

The root of the path, if any.

stem

The final path component, minus its last suffix.

suffix

The final component’s last suffix, if any.

suffixes

A list of the final component’s suffixes, if any.