on-internet
← Community

Use case for low-level os.open, os.fdopen, and friends?

Stack Overflow ·

In Python 3.2 (and other versions), the documentation for os.open states: This function is intended for low-level I/O. For normal usage, use the built-in function open(), which returns a file object with read() and write() methods (and many more). To wrap a file descriptor in a file object, use fdopen(). And for fdopen(): Return an open file object connected to the file descriptor fd. This is an alias of open() and accepts the same arguments. The only difference is that the first argument of fdopen() must always be an integer. This comment in a question on the difference between io.open and os

Comments

Sign in or sign up to comment and upvote.

No comments yet.