Unsolved How setCaching works?
-
Hi,
I would like to check many times ( for example in a loop ) if file exists. This file is in a share folder ( samba ) and sometimes this share folder isn't exists. I check
QFileInfo
class and I find methodsetCaching
. So I thought, that if I did:QFileInfo fileInfo(R"(\\192.168.200.200\someFile.txt)"); fileInfo.setCaching(false); for(int i=0;i<10;i++) { qInfo()<<fileInfo.exists(); }
I will have to check 10 times for example 25 seconds ( so for all 250 seconds ). But I have to wait only once - 25 seconds. Next 9 times was very fast ( less than 1 seconds for all ), so ( 26 seconds for all ).
I would like to check if file exists 10 times, not using cache, so I would like to wait 250 seconds.
I know about connectToHost, but this method sometimes not works for me ( I know that folder exists ( I can go to it using windows explorer ), but connectToHost can't connect to it ).
-
@qwe3
The timing may have nothing to do with Qt implementation code (especially with your no caching). It may be that the timings/behaviour come from the OS/Samba behaviour. -
This post is deleted! -