cga_util.py 文件源码

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

项目:firecloud_developer_toolkit 作者: broadinstitute 项目源码 文件源码
def safe_make_symlink(input_file_path,output_file_path):
    output_file_dir = os.path.dirname(output_file_path)
    # Verify the input file is actually there
    if not os.path.exists(input_file_path):
        raise Exception("can't find file %s"%input_file_path)
    safe_make_dirs(output_file_dir)
    try:
        os.symlink(input_file_path,output_file_path)
    except OSError as err:
        if err.errno == errno.EEXIST:
            # link already exists, check that it is identical to the one we are trying to put down
            old = os.path.realpath(input_file_path)
            new = os.path.realpath(output_file_path)
            if old != new:
                raise Exception('Existing file is different than the new symlink')
        else:
            raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号