[Interest] QStorageInfo bug?

Alexander Dyagilev alervdvcw at gmail.com
Wed Jul 19 09:51:38 CEST 2017


Hello,

|Mac OS X El Capitan 10.11.6|.

I have an external drive. In my app, I monitor for it to be connected to 
PC. I use |QStorageInfo| for this providing it with the drive's root path.

On that drive I have a file with a known path to it. I need to check if 
the file exists once the drive is connected.

The problem is that once I connect the drive, |QStorageInfo| starts to 
return |true| for both |isValid| and |isReady|, but |QFile::exists| 
returns |false| while the file is really exists on the drive. It keeps 
returning |false| for a few seconds. After that seconds it starts 
returning |true|.

Is it a bug in Qt/MAC or am I missing something?

Qt 5.9.1.

P.S. It works fine on Windows 10.

Code Example.

|QStorageInfos(storageRootPath);if(s.isValid()&&s.isReady()){autoexists 
=QFile::exists(pathToFile);// getting false here for a few seconds}|

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170719/c43e57b7/attachment.html>


More information about the Interest mailing list