-
-
Notifications
You must be signed in to change notification settings - Fork 830
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
Remove Boost-Filesystem and replace it with the std::filesystem
#1642
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7f6265c
to
09985ba
Compare
6d20ed2
to
0c91db3
Compare
9b2a916
to
71720a4
Compare
This commit removes Boost::filesystem from all the executables. For executables that included modules that are still using Boost::filesystem, the specific included files in these modules have been modified to also replace Boost::filesystem calls by std::filesystem ones.
471e822
to
533fe78
Compare
This is meant to be used as a replacement for `boost::filesystem::unique_path()` as it is not part of `std::filesystem` yet because of a potential exploit (https://stackoverflow.com/a/43318175).
…` with `std::filesystem`
…m` with `std::filesystem`
…th `std::filesystem`
533fe78
to
32fbd24
Compare
fabiencastan
approved these changes
Jan 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR replaces all the calls to
boost::filesystem
by calls tostd::filesystem
when possible, and alternatives when it is not. Since C++17, most of the functions inboost::filesystem
are part of the standard "filesystem" library.As a consequence, Boost-Filesystem is removed from the list of dependencies.
Implementation remarks
boost::filesystem::unique_path()
has not been ported to thestd::filesystem
because of security reasons (https://stackoverflow.com/questions/43316527/what-is-the-c17-equivalent-to-boostfilesystemunique-path): we replaced any call to it with a specific utilitary function,generateUniqueFilename()
, which mimicsunique_path()
.boost::filesystem::last_write_time(path)
returned anstd::time_t
whereasstd::filesystem::last_write_time(path)
returns anstd::filesystem::file_time_type
, which cannot be directly cast to anstd::time_t
. To address this issue, we use a utilitary function to get the last write time by ourselves, based on OIIO's function for that specific operation.