comparison mercurial/util_win32.py @ 5935:0973501e5f4a

win32: remove excessive flushing Our Windows file code was flushing buffers from the operating system to disk, rather than from the application to the operating system.
author Matt Mackall <mpm@selenic.com>
date Wed, 30 Jan 2008 17:30:34 -0600
parents cacfeee38870
children 821fc5c0656c
comparison
equal deleted inserted replaced
5934:e495f3f35b2d 5935:0973501e5f4a
292 if not self.closed: 292 if not self.closed:
293 self.handle = None 293 self.handle = None
294 self.closed = True 294 self.closed = True
295 295
296 def flush(self): 296 def flush(self):
297 try: 297 # we have no application-level buffering
298 win32file.FlushFileBuffers(self.handle) 298 pass
299 except pywintypes.error, err:
300 raise WinIOError(err)
301 299
302 def truncate(self, pos=0): 300 def truncate(self, pos=0):
303 try: 301 try:
304 win32file.SetFilePointer(self.handle, int(pos), 302 win32file.SetFilePointer(self.handle, int(pos),
305 win32file.FILE_BEGIN) 303 win32file.FILE_BEGIN)