How to effectively overwrite entire folders in Qt C++?
-
wrote on 19 Sept 2022, 18:15 last edited by
Hello!
If I have two QDir objects
QDir source; QDir destiny;
How can I effectively overwrite
source
intodestiny
using Qt?I want every existing file to be overwritten (the
source
version will be copied ontodestiny
) and any folders that are not present atdestiny
should 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
source
and then remove/copy ontodestiny
?
Then if it's a folder do I have to actuallyQDir::cd
into 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::rename
that 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.
1/5