linux
mkdir -p "$d" && cp file "$d"
windows
xcopy file.txt c:\new\path\file.txt*
/y overwrite
* -> file
c++
//std::string command = "xcopy file.txt c:\\new\\path\\file.txt*";
std::ostringstream oss;
oss << "xcopy " <<"\""<<entry.path().string() << "\"" << " " << destanation << "*"; // prevent space in source path
std::string command = oss.str();
system(command.c_str());