| 14 | namespace fs = boost::filesystem; |
| 15 | |
| 16 | int main( int argc, char* argv[] ) |
| 17 | { |
| 18 | |
| 19 | if ( argc != 2 ) |
| 20 | { |
| 21 | std::cout << "Usage: file_size path\n"; |
| 22 | return 1; |
| 23 | } |
| 24 | |
| 25 | std::cout << "sizeof(intmax_t) is " << sizeof(boost::intmax_t) << '\n'; |
| 26 | |
| 27 | fs::path p( argv[1] ); |
| 28 | |
| 29 | if ( !fs::exists( p ) ) |
| 30 | { |
| 31 | std::cout << "not found: " << argv[1] << std::endl; |
| 32 | return 1; |
| 33 | } |
| 34 | |
| 35 | if ( !fs::is_regular( p ) ) |
| 36 | { |
| 37 | std::cout << "not a regular file: " << argv[1] << std::endl; |
| 38 | return 1; |
| 39 | } |
| 40 | |
| 41 | std::cout << "size of " << argv[1] << " is " << fs::file_size( p ) |
| 42 | << std::endl; |
| 43 | return 0; |
| 44 | } |
nothing calls this directly
no test coverage detected