doorxp

Blog

getTotalDiskSize

+ (long long)getTotalDiskSize{

    struct statfs buf;

    unsigned long long freeSpace = -1;

    if (statfs("/var", &buf) >= 0)

    {

        freeSpace = (unsigned long long)(buf.f_bsize * buf.f_blocks);

    }

    return freeSpace;

}


+ (long long)getAvailableDiskSize{

    struct statfs buf;

    unsigned long long freeSpace = -1;

    if (statfs("/var", &buf) >= 0)

    {

        freeSpace = (unsigned long long)(buf.f_bsize * buf.f_bavail);

    }

    return freeSpace;

}


发表评论:

«   2024年11月   »
123
45678910
11121314151617
18192021222324
252627282930
控制面板
您好,欢迎到访网站!
  查看权限
网站分类
搜索
最新留言

    Powered By Z-BlogPHP 1.5.1 Zero

    Copyright doorxp.com Rights Reserved.