diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 531a699..58e72f6 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -1560,6 +1560,18 @@ def expanduser(self): return self + def can_read(self): + """Returns true if the current user can read the current path""" + return os.access(str(self), os.R_OK) + + def can_write(self): + """Returns true if the current user can write the current path""" + return os.access(str(self), os.W_OK) + + def can_execute(self): + """Returns true if the current user can execute the current path""" + return os.access(str(self), os.X_OK) + class PosixPath(Path, PurePosixPath): """Path subclass for non-Windows systems.