FileMode
FileMode is used to specify the mode in which a file is opened.
| attributes | description |
|---|---|
| Create | If the file does not exist, create a new file for writing. If the file already exists, truncate the file and then reopen it. If the file does not exist, Create will create the file. |
| Open | Open the file in read-only mode. |
| OpenOrCreate | Open an existing file; if the file does not exist, create the file. It allows for reading and writing operations on the file. |
| Truncate | Open and truncate a file. |
