Mode Meaning
---- -------
r Opens file for reading
w Creates a new file (or erases an existing one)
for writing
a Appends (opens for writing at end of file)
b Specifies that file contains binary data
+ Specifies that file is being opened for update
(both reading and writing)
Mode parameters can be combined: for example, "r+b"
and "a+" are both valid file modes.