515
515
except (IOError, OSError),e:
516
516
self._translate_error(e, path)
518
def link(self, source, link_name):
519
"""See Transport.link."""
521
os.link(self._abspath(source),
522
self._abspath(link_name))
524
except AttributeError:
525
raise errors.TransportNotPossible("Hardlinks are not supported on %s" % self)
526
except (IOError, OSError), e:
527
self._translate_error(e, source)
529
def symlink(self, source, link_name):
530
"""See Transport.symlink."""
531
abs_link_dirpath = urlutils.dirname(self.abspath(link_name))
532
source_rel = urlutils.file_relpath(
533
urlutils.strip_trailing_slash(abs_link_dirpath),
534
urlutils.strip_trailing_slash(self.abspath(source))
538
os.symlink(source_rel, self._abspath(link_name))
540
except AttributeError:
541
raise errors.TransportNotPossible("Symlinks are not supported on %s" % self)
542
except (IOError, OSError), e:
543
self._translate_error(e, source_rel)
518
545
def _can_roundtrip_unix_modebits(self):
519
546
if sys.platform == 'win32':