How to effectively overwrite entire folders in Qt C++?
-
Hello!
If I have two QDir objects
QDir source; QDir destiny;How can I effectively overwrite
sourceintodestinyusing Qt?I want every existing file to be overwritten (the
sourceversion will be copied ontodestiny) and any folders that are not present atdestinyshould be copied.I couldn't find in the documentation anything specifically for that. Am I missing something?
Do I have to actually just iterate through every file in
sourceand then remove/copy ontodestiny?
Then if it's a folder do I have to actuallyQDir::cdinto them and do the same thing (if it exists atdestiny)?I'm asking here because I think I'm missing something. Isn't there something like
QDir::renamethat actually works when directories already exist? -
Then you can use QDirIterator to go through your source folder and copy files/create folder based on what it provides you.
-
Hi,
Are you trying to reimplement something like the rsync utility ?
-
Then you can use QDirIterator to go through your source folder and copy files/create folder based on what it provides you.
-
Then you can use QDirIterator to go through your source folder and copy files/create folder based on what it provides you.