I want to synchronize two folders/directories. The constrains are follow:
1) Each folder should have at least all files/subfolders from the targetsource folder.
2) Each folder should contain the newest file/subfolder of both.
I'm at time still unsure, how I could accomplish that. The main problem I have is, that I'm unsure about which container type will be at best suitable for this purpose. Also, I'm unsure about, how I could compare the files of a folder, respective its subfolders.
You usually wouldn't compare the contents of the files. You'd generate file hashs and compare the hashs.
For C++17::filesystem, there's functions to obtain the last write time, iterate folders recursively and to copy file(s) between folders. See https://en.cppreference.com/w/cpp/header/filesystem for detials
I'm unsure about which container type will be at best suitable for this purpose.
You don't need a container if you use the C++17::filesystem folder iterate methods.
At best it would be platform independent.
The program as such should run on an *X system. The file system at source EXT4 (but I'm not sure), and at target some FAT, i guess. I'ts at a smartphone respective a portable music player (both via usb connection).