Welcome to mirror list, hosted at ThFree Co, Russian Federation.

statfs_example.cpp « example « attic - github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 122c07e04802a39dfffdd82dd91ea6e09d779356 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "afio_pch.hpp"

int main(void)
{
    //[statfs_example
    boost::afio::current_dispatcher_guard h(boost::afio::make_dispatcher().get());
    
    // Open the root directory
    boost::afio::handle_ptr rootdir(boost::afio::dir("/"));

    // Ask the filing system of the root directory how much free space there is
    boost::afio::statfs_t statfs(boost::afio::statfs(rootdir,
        boost::afio::fs_metadata_flags::bsize|boost::afio::fs_metadata_flags::bfree));
    
    std::cout << "Your root filing system has "
        << (statfs.f_bfree*statfs.f_bsize/1024.0/1024.0/1024.0) << " Gb free." << std::endl;
    //]
}