On this page
posix.dup
Prev: posix.DirEntry | Up: posix | Next: posix.dup2
Rel: posix.abort, posix.access, posix.chdir, posix.chflags
Ref: docs.python.org — posix.dup
Tags: #public #python3 #stdlib #posix
Import
import posix
from posix import dup
Signature & Overview
posix.dup(fd, /)
Return a duplicate of a file descriptor.
Usage
import os
r, w = os.pipe()
d = os.dup(r)
os.close(d); os.close(r); os.close(w)
Gotchas
- Import via
os.dup.
REPL Inspect
from posix import dup
help(dup)
Linked from
Related notes
- tuts/python3/stdlib_module/posix/DirEntry Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/dup2 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