On this page
posix.dup2
Prev: posix.dup | Up: posix | Next: posix.error
Rel: posix.abort, posix.access, posix.chdir, posix.chflags
Ref: docs.python.org — posix.dup2
Tags: #public #python3 #stdlib #posix
Import
import posix
from posix import dup2
Signature & Overview
posix.dup2(fd, fd2, inheritable=True)
Duplicate file descriptor.
Usage
import os
# Duplicates fd onto fd2 (closing fd2 first if open)
assert callable(os.dup2)
Gotchas
- Import via
os.dup2.
REPL Inspect
from posix import dup2
help(dup2)
Linked from
Related notes
- tuts/python3/stdlib_module/posix/dup Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/error Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/posix/abort Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/access Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chdir Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chflags Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chmod shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chown shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chroot shared tags: #posix, #stdlib