def _openFile(self):
        """
        Open the log file.
        """
        self.closed = False
        if os.path.exists(self.path):
            self._file = file(self.path, "r+", 1)
            self._file.seek(0, 2)
        else:
            if self.defaultMode is not None:
                # Set the lowest permissions
                oldUmask = os.umask(0777)
                try:
                    self._file = file(self.path, "w+", 1)
                finally:
                    os.umask(oldUmask)
            else:
                self._file = file(self.path, "w+", 1)
        if self.defaultMode is not None:
            try:
                os.chmod(self.path, self.defaultMode)
            except __HOLE__:
                # Probably /dev/null or something?
                pass
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/python/logfile.py/BaseLogFile._openFile