الفرق بين المراجعتين لصفحة: «Python/pathlib/Path/samefile»
أنشأ الصفحة ب'== التابع Path.cwd == يعيد كائن مسار جديدًا يمثّل المسار الحالي (بشكل مشابه للتابع os.getcwd)<syntaxhighlight lan...' |
لا ملخص تعديل |
||
سطر 1: | سطر 1: | ||
== التابع Path. | == التابع Path.samefile == | ||
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.<syntaxhighlight lang="python3"> | |||
>>> p = Path('spam') | |||
>>> q = Path('eggs') | |||
>>> p.samefile(q) | |||
False | |||
>>> p.samefile('spam') | |||
True | |||
</syntaxhighlight> | |||
New in version 3.5. |
مراجعة 07:44، 3 أغسطس 2018
التابع Path.samefile
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.