Create a symbolic link with the given value (pointing to another name).
(self, value, absolute=1)
| 322 | error.checked_call(os.link, str(oldname), str(self)) |
| 323 | |
| 324 | def mksymlinkto(self, value, absolute=1): |
| 325 | """Create a symbolic link with the given value (pointing to another name).""" |
| 326 | if absolute: |
| 327 | error.checked_call(os.symlink, str(value), self.strpath) |
| 328 | else: |
| 329 | base = self.common(value) |
| 330 | # with posix local paths '/' is always a common base |
| 331 | relsource = self.__class__(value).relto(base) |
| 332 | reldest = self.relto(base) |
| 333 | n = reldest.count(self.sep) |
| 334 | target = self.sep.join(("..",) * n + (relsource,)) |
| 335 | error.checked_call(os.symlink, target, self.strpath) |
| 336 | |
| 337 | def __div__(self, other): |
| 338 | return self.join(os.fspath(other)) |