file_size.cpp 461 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef __VIC_USE_MODULES
  2. #include<__vic/fs.h>
  3. #include<iostream>
  4. #include<exception>
  5. #endif
  6. #include<cassert>
  7. #ifdef __VIC_USE_MODULES
  8. import std;
  9. import __vic;
  10. #endif
  11. void run_tests()
  12. {
  13. std::cout << "File size is " <<
  14. __vic::file_size("file_size.cpp") << " bytes\n";
  15. }
  16. int main()
  17. {
  18. try
  19. {
  20. run_tests();
  21. return 0;
  22. }
  23. catch(const std::exception &ex)
  24. {
  25. std::cerr << ex.what() << '\n';
  26. }
  27. return 1;
  28. }