ID EN
OS

open

Python 3.11

Open the file path and set various flags according to flags and possibly its mode according to mode. When computing mode, the current umask value is first masked out. Return the file descriptor for the newly opened file. The new file descriptor is non-inheritable.

Syntax

PYTHON
os.open(path, flags, mode=0o777, *, dir_fd=None)

See Also

non-inheritable O_RDONLY O_WRONLY os O_BINARY paths relative to directory descriptors auditing event open()