On this page
genericpath.samestat
Prev: genericpath.sameopenfile | Up: genericpath
Rel: genericpath.commonprefix, genericpath.exists, genericpath.getatime, genericpath.getctime
Ref: docs.python.org — genericpath.samestat
Tags: #public #python3 #stdlib #genericpath
Import
import genericpath
from genericpath import samestat
Signature & Overview
genericpath.samestat(s1, s2)
Test whether two stat buffers reference the same file
Usage
import os
s1, s2 = os.stat("."), os.stat(os.path.abspath("."))
assert os.path.samestat(s1, s2) is True
Gotchas
- Compares two
os.stat_resulttuples without making additional syscalls.
REPL Inspect
from genericpath import samestat
help(samestat)
Linked from
Related notes
- tuts/python3/stdlib_module/genericpath/sameopenfile Linked here; links to this page; shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/genericpath/commonprefix Linked here; shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath/exists Linked here; shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath/getatime Linked here; shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath/getctime Linked here; shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath/getmtime shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath/getsize shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath/isdevdrive shared tags: #genericpath, #stdlib
- tuts/python3/stdlib_module/genericpath/isdir shared tags: #genericpath, #stdlib