-
Notifications
You must be signed in to change notification settings - Fork 277
add file_exists(path) #5215
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
add file_exists(path) #5215
Conversation
This offers the obvious wrapper around the OS-specific access() function, to be used until we switch to C++17.
aac2283
to
ecba483
Compare
Added file_remove, the obvious wrapper around the OS-specific unlink. This will be replaced by std::filesystem::remove once we have C++17.
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.
Seems reasonable to me, I guess this code is already plenty exercised by existing tests?
@@ -124,8 +125,8 @@ int hybrid_binary( | |||
} | |||
|
|||
// delete the goto binary | |||
int remove_result = remove(goto_binary_file.c_str()); | |||
if(remove_result != 0) | |||
bool remove_result = file_remove(goto_binary_file); |
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.
⛏ const
@@ -64,8 +65,8 @@ int hybrid_binary( | |||
} | |||
|
|||
// delete the goto binary | |||
int remove_result = remove(goto_binary_file.c_str()); | |||
if(remove_result != 0) | |||
bool remove_result = file_remove(goto_binary_file); |
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.
⛏ const
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.
Looks sensible. I concur with Peter's nit picks about const
but nothing blocking.
This offers the obvious wrapper around the OS-specific
access()
andremove
/unlink
functions, to be used until we switch to C++17.