comparison mercurial/appendfile.py @ 2027:94d3170399e1

work around python bug on solaris 10. write to file opened mode 'a+' should write to end of file and update offset pointer, but does not (solaris 10 has python 2.3.3). fix is to always seek.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Thu, 30 Mar 2006 19:28:41 -0800
parents db1eb0de286a
children 343aeefb553b
comparison
equal deleted inserted replaced
2026:24c604628867 2027:94d3170399e1
68 self.offset += len(s) 68 self.offset += len(s)
69 return fp.getvalue() 69 return fp.getvalue()
70 70
71 def write(self, s): 71 def write(self, s):
72 '''append to temp file.''' 72 '''append to temp file.'''
73 self.tmpfp.seek(0, 2)
73 self.tmpfp.write(s) 74 self.tmpfp.write(s)
74 # all writes are appends, so offset must go to end of file. 75 # all writes are appends, so offset must go to end of file.
75 self.offset = self.fpsize + self.tmpfp.tell() 76 self.offset = self.fpsize + self.tmpfp.tell()
76 77
77 def writedata(self): 78 def writedata(self):