-
Notifications
You must be signed in to change notification settings - Fork 80
example for file_size() usage #20
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,17 +25,41 @@ int main(int argc, char **argv) { | |
| cout << "some/path.ext:operator==() (unequal) = " << (path("some/path.ext") == path("another/path.ext")) << endl; | ||
|
|
||
| cout << "nonexistant:exists = " << path("nonexistant").exists() << endl; | ||
| try | ||
| { | ||
| cout << "nonexistant:file_size = " << path("nonexistant").file_size() << endl; | ||
| } | ||
| catch(std::runtime_error e) | ||
| { | ||
| cout << "<file does not exist>" << endl; | ||
| } | ||
| cout << "nonexistant:is_file = " << path("nonexistant").is_file() << endl; | ||
| cout << "nonexistant:is_directory = " << path("nonexistant").is_directory() << endl; | ||
| cout << "nonexistant:filename = " << path("nonexistant").filename() << endl; | ||
| cout << "nonexistant:extension = " << path("nonexistant").extension() << endl; | ||
| try | ||
| { | ||
| cout << "filesystem/path.h:file_size = " << path("filesystem/path.h").file_size() << endl; | ||
| } | ||
| catch(std::runtime_error e) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing here |
||
| { | ||
| cout << "<file does not exist>" << endl; | ||
| } | ||
| cout << "filesystem/path.h:exists = " << path("filesystem/path.h").exists() << endl; | ||
| cout << "filesystem/path.h:is_file = " << path("filesystem/path.h").is_file() << endl; | ||
| cout << "filesystem/path.h:is_directory = " << path("filesystem/path.h").is_directory() << endl; | ||
| cout << "filesystem/path.h:filename = " << path("filesystem/path.h").filename() << endl; | ||
| cout << "filesystem/path.h:extension = " << path("filesystem/path.h").extension() << endl; | ||
| cout << "filesystem/path.h:make_absolute = " << path("filesystem/path.h").make_absolute() << endl; | ||
| cout << "../filesystem:exists = " << path("../filesystem").exists() << endl; | ||
| try | ||
| { | ||
| cout << "../filesystem:file_size = " << path("../filesystem").file_size() << endl; | ||
| } | ||
| catch(std::runtime_error e) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here :)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
| { | ||
| cout << "<file does not exist>" << endl; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should include "../filesystem:file_size = ".
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this part of the try block actually gets executed |
||
| } | ||
| cout << "../filesystem:is_file = " << path("../filesystem").is_file() << endl; | ||
| cout << "../filesystem:is_directory = " << path("../filesystem").is_directory() << endl; | ||
| cout << "../filesystem:extension = " << path("../filesystem").extension() << 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 just be
catch(std::exception &e)