utils.py 文件源码

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

项目:unionfs_cleaner 作者: l3uddz 项目源码 文件源码
def opened_files(path, excludes):
    files = []

    try:
        process = os.popen('lsof -wFn +D %s | tail -n +2 | cut -c2-' % cmd_quote(path))
        data = process.read()
        process.close()
        for item in data.split('\n'):
            if not item or len(item) <= 2 or os.path.isdir(item) or item.isdigit() or file_excluded(item, excludes):
                continue
            files.append(item)

        return files

    except Exception as ex:
        logger.exception("Exception checking %r: ", path)
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号