On this page
  1. genericpath.samefile
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

genericpath.samefile

Prev: genericpath.lexists | Up: genericpath | Next: genericpath.sameopenfile
Rel: genericpath.commonprefix, genericpath.exists, genericpath.getatime, genericpath.getctime
Ref: docs.python.org — genericpath.samefile
Tags: #public #python3 #stdlib #genericpath


Import

import genericpath
from genericpath import samefile

Signature & Overview

genericpath.samefile(f1, f2)

Test whether two pathnames reference the same actual file or directory This is determined by the device number and i-node number and raises an exception if an os.stat() call on either pathname fails.

Usage

import os

assert os.path.samefile(".", os.path.abspath(".")) is True

Gotchas

REPL Inspect

from genericpath import samefile
help(samefile)

Linked from

Related notes