1 | r | This will be used to open file for reading and through exception if the file soes not exist. |
2 | r+ | Here this flag is use to read or write file and this will also produce error if the file does not exist. |
3 | rs | Well from this flag file is open for reading in synchronous mode. |
4 | rs+ | Well this flag is use to read or write on file and this will also tell the OS to open it synchronously. |
5 | w | Well this flag is mainly used for writing. and this will crete the file if it is not exist or truncate the file if it is exists. |
6 | wx | Well this flag is same as 'w' but fails if path exists. |
7 | w+ | This flag is used to open file for reading and writing. the file is created (if it does not exist) or truncated (if it exists). |
8 | wx+ | This will work same as 'w+' but fails of path exists. |
9 | a | This will be used to open file for appending and this will create a file it is does not exist. |
10 | ax | This flag will do the same as we do in flag 'a' but this will fails if path exists. |
11 | a+ | This flag is used to open file for reading and appending. And file is created if it is not exist. |
12 | ax+ | This flag os used to open file for reading and appedning and this will create a file if it does not exist.
|