2,732
edits
Red Leader (talk | contribs) (→open(): More doc) |
Red Leader (talk | contribs) (→open(): More doc) |
||
Line 117: | Line 117: | ||
! String !! Meaning | ! String !! Meaning | ||
|- | |- | ||
| r || | | <code>r</code> || Opens a file for input (reading) operations. The file must exist. | ||
|- | |- | ||
| w || Creates a new file for output (writing) operations. If the file already exists, its contents will be cleared first. | | <code>w</code> || Creates a new file for output (writing) operations. If the file already exists, its contents will be cleared first. | ||
|- | |||
| <code>a</code> || Opens a file for appending data. The file is created if it does not exist. | |||
|- | |||
| <code>r+</code> || Open for input and output operations as a text file. The file must exist. | |||
|- | |||
| <code>w+</code> || Creates a new file for input and output operations. If the file already exists, its contents will be cleared first. | |||
|- | |||
| <code>a+</code> || Opens a file for input and output operations. Output operations will append data to the end of the file. Input operations are affected by {{func link|seek}}, but output operations will move the position back to the end of the file. The file is created if it does not exist. | |||
|} | |} | ||