~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

Abbreviate pack_stat struct format to '>6L'

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
 
73
73
        super(LocalTransport, self).__init__(base)
74
74
        self._local_base = urlutils.local_path_from_url(base)
 
75
        if self._local_base[-1] != '/':
 
76
            self._local_base = self._local_base + '/'
75
77
 
76
78
    def clone(self, offset=None):
77
79
        """Return a new LocalTransport with root at self.base + offset
327
329
 
328
330
    def open_write_stream(self, relpath, mode=None):
329
331
        """See Transport.open_write_stream."""
330
 
        # initialise the file
331
 
        self.put_bytes_non_atomic(relpath, "", mode=mode)
332
332
        abspath = self._abspath(relpath)
333
 
        handle = osutils.open_file(abspath, 'wb')
 
333
        try:
 
334
            handle = osutils.open_file(abspath, 'wb')
 
335
        except (IOError, OSError),e:
 
336
            self._translate_error(e, abspath)
 
337
        handle.truncate()
334
338
        if mode is not None:
335
339
            self._check_mode_and_size(abspath, handle.fileno(), mode)
336
340
        transport._file_streams[self.abspath(relpath)] = handle