diff --git a/voussoirkit/pathclass.py b/voussoirkit/pathclass.py index ad159fd..07442df 100644 --- a/voussoirkit/pathclass.py +++ b/voussoirkit/pathclass.py @@ -357,8 +357,19 @@ class Path: def is_file(self): return os.path.isfile(self) + @property + def is_junction(self): + try: + return bool(os.readlink(self)) + except (FileNotFoundError, OSError): + return False + @property def is_link(self): + return self.is_symlink or self.is_junction + + @property + def is_symlink(self): return os.path.islink(self) def join(self, subpath, **spawn_kwargs):