<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _create_file_racefree(self, file):
 """ Creates a file, but fails if the file already exists. This function will thus only succeed if this process actually creates the file; if the file already exists, it will cause an OSError, solving race conditions. :param str file: File to create. """

        write_lock_flags = os.O_CREAT | os.O_EXCL | os.O_WRONLY
        os.open(file, write_lock_flags)