How to work with files from many folders inside one folder?
-
I have several files, which spread in many folder inside a main directory.
Now I have a list of file names, the task is I have to compare the names from the list and file's name from the main folder's folders.
My problem is I don't know which Qt class's funtion is best to solve this with shortest code possible.
Please lead me with some simple example!
Any replies are really appreciated!
-
Take a look at this
"QFile::copy()":http://doc.qt.digia.com/qt/qfile.html#copy
One example is on stackoverflow "here":http://stackoverflow.com/questions/3227622/how-to-copy-a-image-file-in-qtIf you want to copy from different directoriey, you'll need to use upper code with combination of QDir class and recursively search for files.
With "this":http://qt-project.org/doc/qt-4.8/qdir.html#entryList you can get all files and directories in a specific directory.
Note: First to returns are ussualy "." and "..", which mean current and parent directory.Regards,
Jake