On this page
posix.closerange
Prev: posix.close | Up: posix | Next: posix.confstr
Rel: posix.abort, posix.access, posix.chdir, posix.chflags
Ref: docs.python.org — posix.closerange
Tags: #public #python3 #stdlib #posix
Import
import posix
from posix import closerange
Signature & Overview
posix.closerange(fd_low, fd_high, /)
Closes all file descriptors in [fd_low, fd_high), ignoring errors.
Usage
import os
# Closes all open file descriptors in [fd_low, fd_high), ignoring errors
assert callable(os.closerange)
Gotchas
- Low-level daemon/fork helper: Prefer
subprocessclose_fds=True.
REPL Inspect
from posix import closerange
help(closerange)
Linked from
Related notes
- tuts/python3/stdlib_module/posix/close Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/confstr 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