58
self.tmpfilename = '%s.%d.%s.%s.tmp' % (filename, _pid, _hostname,
62
61
self.realfilename = filename
64
63
flags = os.O_EXCL | os.O_CREAT | os.O_WRONLY
66
65
flags |= osutils.O_BINARY
73
74
# Use a low level fd operation to avoid chmodding later.
74
75
# This may not succeed, but it should help most of the time
75
76
self._fd = os.open(self.tmpfilename, flags, local_mode)