ID EN
OS

dup2

Python 3.11

Duplicate file descriptor fd to fd2, closing the latter first if necessary. Return fd2. The new file descriptor is inheritable by default or non-inheritable if inheritable is False.

Syntax

PYTHON
os.dup2(fd, fd2, inheritable=True)

See Also

inheritable Availability