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

ntpath.sameopenfile

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


Import

import ntpath
from ntpath import sameopenfile

Signature & Overview

ntpath.sameopenfile(fp1, fp2)

Test whether two open file objects reference the same file

Usage

import ntpath, tempfile

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

Gotchas

REPL Inspect

from ntpath import sameopenfile
help(sameopenfile)

Linked from

Related notes