operating system services open(file [flags [mode]]opens the file file flags is the bitwise or of the following constant valuesvalue description o_rdonly o_wronly open the file for reading open the file for writing open for reading and writing (updatesappend bytes to the end of the file create the file if it doesn' exist don' block on openreador write (unixsame as o_nonblock (unixsynchronous writes (unixwhen opening devicedon' set controlling terminal (unixif the file existstruncates to zero length synchronous reads (unixsynchronous writes (unixerror if o_creat and the file already exists set an exclusive lock on the file set shared lock on the file enables asynchronous input mode in which sigio signal is generated with input is available use direct / mode where reads and writes go directly to the disk instead of the operating system read/write caches raises an error if the file is not directory don' follow symbolic links don' update the last access time of the file text mode (windowsbinary mode (windowsfile not inherited by child processes (windowshint to system that the file is used for short-term storage (windowsdelete file when closed (windowshint to system that file will be used for random access (windowshint to system that file will be accessed sequentially (windowso_rdwr o_append o_creat o_nonblock o_ndelay o_dsync o_noctty o_trunc o_rsync o_sync o_excl o_exlock o_shlock o_async o_direct o_directory o_nofollow o_noatime o_text o_binary o_noinherit o_short_lived o_temporary o_random o_sequential synchronous / modes (o_synco_dsynco_rsyncforce / operations to block until they've been completed at the hardware level (for examplea write will block until the bytes have been physically written to diskthe mode parameter contains the file permissions represented as the bitwise or of the following octal values (which are defined as constants in the stat module as indicated)mode meaning user has execute permission (stat s_ixusruser has write permission (stat s_iwusruser has read permission (stat s_irusruser has read/write/exec permission (stat s_irwxuf lib fl ff