tut1.cpp 569 B

1234567891011121314151617181920212223
  1. // filesystem tut1.cpp ---------------------------------------------------------------//
  2. // Copyright Beman Dawes 2009
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // See http://www.boost.org/LICENSE_1_0.txt
  5. // Library home page: http://www.boost.org/libs/filesystem
  6. #include <iostream>
  7. #include <boost/filesystem.hpp>
  8. using namespace boost::filesystem;
  9. int main(int argc, char* argv[])
  10. {
  11. if (argc < 2)
  12. {
  13. std::cout << "Usage: tut1 path\n";
  14. return 1;
  15. }
  16. std::cout << argv[1] << " " << file_size(argv[1]) << '\n';
  17. return 0;
  18. }