#include #include #include #include #include unsigned long getFreeSpace() { struct statvfs stat; std::string conf_path(getpwuid(getuid())->pw_dir); conf_path += "/.config/"; std::cout<< conf_path << std::endl; if (statvfs(conf_path.c_str(), &stat) != 0) return 0; //error!.. //free space size is (f_bsize * f_bavail) //unsigned long f_bsize; //fsblkcnt_t f_bavail return stat.f_bsize * stat.f_bavail; } unsigned long getFreeSpace(std::string conf_path) { struct statvfs stat; if (statvfs(conf_path.c_str(), &stat) != 0) return 0; //error!.. //free space size is (f_bsize * f_bavail) //unsigned long f_bsize; //fsblkcnt_t f_bavail return stat.f_bsize * stat.f_bavail; } int main() { std::cout<