Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <sys/stat.h>
- int main (int /*argc*/, char* argv[])
- {
- struct stat fileInfo;
- if (stat (argv[1], &fileInfo) == 0) {
- std::cout << "The file's size is: " << fileInfo.st_size <<
- " bytes" << std::endl;
- } else {
- std::cout << "Unable to stat file (maybe it doesn't exist?)" <<
- std::endl;
- }
- }
Add Comment
Please, Sign In to add comment