-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
example for file_size() usage #20
base: master
Are you sure you want to change the base?
Conversation
path_demo.cpp
Outdated
{ | ||
cout << "nonexistant:file_size = " << path("nonexistant").file_size() << endl; | ||
} | ||
catch(std::runtime_error e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should just be catch(std::exception &e)
path_demo.cpp
Outdated
{ | ||
cout << "filesystem/path.h:file_size = " << path("filesystem/path.h").file_size() << endl; | ||
} | ||
catch(std::runtime_error e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here catch(std::exception &e)
.
path_demo.cpp
Outdated
{ | ||
cout << "../filesystem:file_size = " << path("../filesystem").file_size() << endl; | ||
} | ||
catch(std::runtime_error e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
path_demo.cpp
Outdated
} | ||
catch(std::runtime_error e) | ||
{ | ||
cout << "<file does not exist>" << endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should include "../filesystem:file_size = ".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this part of the try block actually gets executed
output looks like you would expect:
nonexistant:file_size = <file does not exist>
this should fix issue #17