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

posixpath.sameopenfile

Prev: posixpath.samefile | Up: posixpath | Next: posixpath.samestat
Rel: posixpath.abspath, posixpath.basename, posixpath.commonpath, posixpath.commonprefix
Ref: docs.python.org — posixpath.sameopenfile
Tags: #public #python3 #stdlib #posixpath


Import

import posixpath
from posixpath import sameopenfile

Signature & Overview

posixpath.sameopenfile(fp1, fp2)

Test whether two open file objects reference the same file

Usage

import posixpath, tempfile

with tempfile.TemporaryFile() as f:
    assert posixpath.sameopenfile(f.fileno(), f.fileno()) is True

Gotchas

REPL Inspect

from posixpath import sameopenfile
help(sameopenfile)

Linked from

Related notes