os.open(file [,flags [,mode]])
opent een bestand (file) om te schrijven of lezen.
O_RDONLY Open file for reading
O_WRONLY Open file for writing
O_RDWR Open file for read/write
O_APPEND Append to the end of the file
O_CREAT Create file if it doesn’t exit
O_NONBLOCK Don’t block on open,read, or write.
O_TRUNC Truncate to zero length
O_TEXT Text mode (Windows)
O_BINARY Binary mode (Windows)
mode is file access mode according to standard Unix conventions
Voorbeeld:
import os
f = os.open(”foo”, O_WRONLY | O_CREAT, 0644)
Add A Comment
You must be logged in to post a comment.
