def relative_path(parent_dir, dest_path): # TODO: support adding ".." return remove_prefix(parent_dir.rstrip("/") + "/", dest_path)
def map_pathname(self, pathname): return remove_prefix(self._dir_path + "/", pathname)
def chroot_path(chroot_dir, path): return "/" + remove_prefix(chroot_dir.rstrip("/") + "/", path)