pathlib.Path.samefile()

Path.samefile(other_path)

Return whether this path points to the same file as other_path, which can be either a Path object, or a string. The semantics are similar to os.path.samefile() and os.path.samestat().

An OSError can be raised if either file cannot be accessed for some reason.

>>> p = Path('spam')
>>> q = Path('eggs')
>>> p.samefile(q)
False
>>> p.samefile('spam')
True

New in version 3.5.

doc_python
2016-10-07 17:40:31
Comments
Leave a Comment

Please login to continue.