Skip to content

example for file_size() usage#20

Open
vlenhart wants to merge 2 commits intowjakob:masterfrom
vlenhart:issue_17
Open

example for file_size() usage#20
vlenhart wants to merge 2 commits intowjakob:masterfrom
vlenhart:issue_17

Conversation

@vlenhart
Copy link
Copy Markdown

this should fix issue #17

Comment thread path_demo.cpp Outdated
{
cout << "nonexistant:file_size = " << path("nonexistant").file_size() << endl;
}
catch(std::runtime_error e)
Copy link
Copy Markdown
Contributor

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)

Comment thread path_demo.cpp Outdated
{
cout << "filesystem/path.h:file_size = " << path("filesystem/path.h").file_size() << endl;
}
catch(std::runtime_error e)
Copy link
Copy Markdown
Contributor

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).

Comment thread path_demo.cpp Outdated
{
cout << "../filesystem:file_size = " << path("../filesystem").file_size() << endl;
}
catch(std::runtime_error e)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread path_demo.cpp
}
catch(std::runtime_error e)
{
cout << "<file does not exist>" << endl;
Copy link
Copy Markdown
Contributor

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 = ".

Copy link
Copy Markdown
Author

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants