August 1999
Intermediate to advanced
1488 pages
72h 53m
English
file.open(option)
The open() method of the File object is used to open a file to read, write, and/or append to. The method returns true if it is successful and false otherwise. The options passed determine the mode in which the file is opened. The options are specified in Table 8.16.
| Option | Description |
|---|---|
| a | This option opens a file for appending. If the file does not exist, it is created. This method always returns true. |
| a+ | This option opens a file for reading and appending. If the file does not exist, it is created. This method always returns true. |
| r | This option opens a file for reading. If the file exists, the method returns true; otherwise, it returns false. |
| r+ | This option ... |
Read now
Unlock full access