Hello, I have about 3,000,000 small files in a directory tree that needs to be ftped through network.
I use QNetworkAccessManager to handle the job. About 1,000,000 files have been ftped to another computers, so I tar those files and untar into the target computer, and I do
foreach( filename, fileList ) {
if ( !QFile::exists( filename
) ) {
// start ftp filename using QNetworkAccessManager.
}
}
foreach( filename, fileList ) {
if ( !QFile::exists( filename ) ) {
// start ftp filename using QNetworkAccessManager.
}
}
To copy to clipboard, switch view to plain text mode
However, QFile::exists( filename ) takes a lot of time (about 0.02 second ) per file. If I kills the program and restart it, those files that have been checked by QFile::exists( filename ) will return quickly ( 0.001 seconds ), that is 20 times faster.
How can I solve this problem?
Thanks.
Bookmarks