/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: INADA Naoki
  • Date: 2010-02-22 06:56:58 UTC
  • mto: (4634.141.1 2.0-integration)
  • mto: This revision was merged to the branch mainline in revision 5075.
  • Revision ID: songofacandy@gmail.com-20100222065658-e2icuv2xgj9olu6d
Add osutils.open() that uses O_NOINHERIT on Win32.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
_append_flags = os.O_CREAT | os.O_APPEND | os.O_WRONLY | osutils.O_BINARY | osutils.O_NOINHERIT
46
46
_put_non_atomic_flags = os.O_CREAT | os.O_TRUNC | os.O_WRONLY | osutils.O_BINARY | osutils.O_NOINHERIT
47
 
_get_flags = os.O_RDONLY | osutils.O_BINARY | osutils.O_NOINHERIT
48
 
_write_stream_flags = _put_non_atomic_flags
49
47
 
50
48
 
51
49
class LocalTransport(Transport):
162
160
            transport._file_streams[canonical_url].flush()
163
161
        try:
164
162
            path = self._abspath(relpath)
165
 
            return os.fdopen(os.open(path, _get_flags), 'rb')
 
163
            return osutils.open(path, 'rb')
166
164
        except (IOError, OSError),e:
167
165
            if e.errno == errno.EISDIR:
168
166
                return LateReadError(relpath)
331
329
        # initialise the file
332
330
        self.put_bytes_non_atomic(relpath, "", mode=mode)
333
331
        abspath = self._abspath(relpath)
334
 
        handle = os.fdopen(os.open(abspath, _write_stream_flags), 'wb')
 
332
        handle = osutils.open(abspath, 'wb')
335
333
        if mode is not None:
336
334
            self._check_mode_and_size(abspath, handle.fileno(), mode)
337
335
        transport._file_streams[self.abspath(relpath)] = handle