On this page
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
- Takes two integer file descriptors.
REPL Inspect
from ntpath import sameopenfile
help(sameopenfile)
Linked from
Related notes
- tuts/python3/stdlib_module/ntpath/samefile Linked here; links to this page; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/samestat Linked here; links to this page; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/ntpath/abspath Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/basename Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/commonpath Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/commonprefix Linked here; shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/dirname shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/exists shared tags: #ntpath, #stdlib
- tuts/python3/stdlib_module/ntpath/expanduser shared tags: #ntpath, #stdlib