0

I'm trying to copy an entire directory from a USB drive to C: drive on a Windows device. Using <filesystem>. It runs fine, but nothing happens. No errors. Using Visual Studio 2019 and switched language preference to C++17. Looking to insert a USB device into our machines at work and update/replace a certain directory on C: drive. Any ideas?

#include <filesystem>

if (!std::filesystem::exists("F:/WORK STUFF")) {
    std::filesystem::copy("F:/WORK STUFF/Installer/Installer/*", "C:/Installer");
}
Remy Lebeau
  • 505,946
  • 29
  • 409
  • 696
  • You might read through some [documentation](https://en.cppreference.com/w/cpp/filesystem/copy). You most likely need the recursive option and you don't need the `/*`. – Retired Ninja Aug 24 '21 at 22:19
  • 2
    Why would you `copy()` FROM a directory that doesn't `exist()`? Try taking `!` out of your `if` condition – Remy Lebeau Aug 24 '21 at 22:41

0 Answers0