How to determine the type of drive using a cross-platform approach

I am writing a cross-platform application that should create files on certain events, now I have a problem if my target is on a removable drive or a network drive. I want to first create a file in a temporary folder on the local hard drive and then move it to the target in order to avoid data loss in case the target path is deleted.

Now my question is: how to specify the type of path in a cross-platform approach?

+5
source share
2 answers

I think it will be quite difficult to achieve this in a reliable and portable way. I am sure that on all platforms there is SOME way to find out if the disk is local or not, but I would have thought that a much simpler and more reliable solution is to create a local temporary file, regardless of the underlying file system.

0
source

If you use QtMobility, you can use the QSystemStorageInfo class .

0
source

All Articles