(file must be opened for reading and writing) and using file_exists() to a open new or existing file for both reading and writing.