comparison mercurial/util_win32.py @ 4997:81f8ff2a9bf2

posixfile_nt: '+' should allow read access. This fixes unexpected I/O error on committing many files due to cset:8a53b39cd402 (r4902 in crew).
author Shun-ichi GOTO <shunichi.goto@gmail.com>
date Wed, 25 Jul 2007 15:58:10 +0900
parents 8a53b39cd402
children
comparison
equal deleted inserted replaced
4996:a0d37976cd5b 4997:81f8ff2a9bf2
207 # tried to use win32file._open_osfhandle to pass fd to os.fdopen, 207 # tried to use win32file._open_osfhandle to pass fd to os.fdopen,
208 # but does not work at all. wrap win32 file api instead. 208 # but does not work at all. wrap win32 file api instead.
209 209
210 def __init__(self, name, mode='rb'): 210 def __init__(self, name, mode='rb'):
211 access = 0 211 access = 0
212 if 'r' in mode: 212 if 'r' in mode or '+' in mode:
213 access |= win32file.GENERIC_READ 213 access |= win32file.GENERIC_READ
214 if 'w' in mode or 'a' in mode or '+' in mode: 214 if 'w' in mode or 'a' in mode or '+' in mode:
215 access |= win32file.GENERIC_WRITE 215 access |= win32file.GENERIC_WRITE
216 if 'r' in mode: 216 if 'r' in mode:
217 creation = win32file.OPEN_EXISTING 217 creation = win32file.OPEN_EXISTING