objects_server.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:ros-interop 作者: mcgill-robotics 项目源码 文件源码
def symlink_objects_path_to_latest(objects_path):
    """Symlinks 'latest' to the given directory.

    Args:
        objects_path: Path to objects directory.
    """
    objects_root = os.path.dirname(objects_path)
    path_to_symlink = os.path.join(objects_root, "latest")

    try:
        os.symlink(objects_path, path_to_symlink)
    except OSError as e:
        # Replace the old symlink if an old symlink with the same
        # name exists.
        if e.errno == errno.EEXIST:
            os.remove(path_to_symlink)
            os.symlink(objects_path, path_to_symlink)
        else:
            rospy.logerr(
                "Could not create symlink to the latest objects directory")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号