Guest User

Untitled

a guest
Feb 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <sys/stat.h>
  3.  
  4. int main (int /*argc*/, char* argv[])
  5. {
  6. struct stat fileInfo;
  7. if (stat (argv[1], &fileInfo) == 0) {
  8. std::cout << "The file's size is: " << fileInfo.st_size <<
  9. " bytes" << std::endl;
  10. } else {
  11. std::cout << "Unable to stat file (maybe it doesn't exist?)" <<
  12. std::endl;
  13. }
  14. }
Add Comment
Please, Sign In to add comment