common.py 文件源码

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

项目:cli 作者: sparkl 项目源码 文件源码
def garbage_collect():
    """
    Performs a garbage collection of temp dirs not associated with
    a running process.
    """
    for working_dir in os.listdir(get_working_root()):
        pid = int(working_dir)
        if not psutil.pid_exists(pid):
            obsolete_dir = os.path.join(
                get_working_root(),
                working_dir)
            shutil.rmtree(obsolete_dir)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号