This PR replaces all the calls to boost::filesystem by calls to std::filesystem when possible, and alternatives when it is not. Since C++17, most of the functions in boost::filesystem are part of the standard "filesystem" library.
As a consequence, Boost-Filesystem is removed from the list of dependencies.
boost::filesystem::last_write_time(path) returned an std::time_t whereas std::filesystem::last_write_time(path) returns an std::filesystem::file_time_type, which cannot be directly cast to an std::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.
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.