Browse Source

- added code to copy files in store()

master
Andreas Romeyke 3 years ago
parent
commit
da08ff4ff4
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      src/lib/payload.cpp

+ 8
- 0
src/lib/payload.cpp View File

@ -3,6 +3,7 @@
#include <string>
#include <list>
#include <boost/filesystem.hpp>
#include <boost/filesystem/operations.hpp>
//#include <filesystem> // c++17
//namespace fs = std::filesystem;
@ -76,6 +77,13 @@ bool Payload::store( string basedir ) {
string sourcepath = Payload::basedir + relpath;
string targetpath = basedir + relpath;
cout << "map '" << sourcepath << "' to '" << targetpath << "'" <<endl;
fs::path from_fp{ sourcepath };
fs::path to_fp{ targetpath };
fs::path parentdir = to_fp.parent_path();
if (! fs::is_directory (parentdir)) {
fs::create_directory( parentdir );
}
fs::copy_file (from_fp, to_fp);
}
return false;


Loading…
Cancel
Save