PyDocs

Nav

Generic Operating System Services

open

os

function
  • open(path, flags, mode=0o777, *, dir_fd=None)
Open a file for low level IO.  Returns a file descriptor (integer).

If dir_fd is not None, it should be a file descriptor open to
a directory, and path should be relative; path will then be relative to
that directory.
dir_fd may not be implemented on your platform.  If it is unavailable,
using it will raise a NotImplementedError.
Changed in 3.3, 3.4, 3.5, 3.6
  • 3.3: Added the dir_fd parameter.
  • 3.4: The new file descriptor is now non-inheritable.
  • 3.5: If the system call is interrupted and the signal handler does not raise an exception, the function now retries the system call instead of raising an InterruptedError exception (see PEP 475 for the rationale).
  • 3.6: Accepts a path-like object.
0 Examples
No examples for os/open.
See Also
No see-alsos for os/open
0 Notes
No notes for open