How to create a temporary directory in C++?

Version 3 of Boost Filesystem Library provides function unique_path() for generating a path name suitable for creating a temporary file or directory.

using namespace boost::filesystem;

path ph = temp_directory_path() / unique_path();
create_directories(ph);

Leave a Comment