maintool.py 文件源码

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

项目:plugin.program.indigo 作者: tvaddonsco 项目源码 文件源码
def get_free_space_mb(dirname):
    import ctypes
    # import platform
    # if platform.system() == 'Windows':
    if xbmc.getCondVisibility('system.platform.windows'):
        free_bytes = ctypes.c_ulonglong(0)
        total_bytes = ctypes.c_int64()
        ctypes.windll.kernel32.GetDiskFreeSpaceExW(ctypes.c_wchar_p(dirname), None, ctypes.pointer(total_bytes),
                                                   ctypes.pointer(free_bytes))
        return free_bytes.value, total_bytes.value
    else:
        st = os.statvfs(dirname)
        return st.f_bavail * st.f_frsize, st.f_frsize * st.f_blocks
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号