How to check available space on attached pendrive in qt ?
Solved
Mobile and Embedded
-
i need to find available space on attached pen drive. how i can do that ?
because i am getting 2 storage device
i.e.
/dev/sda/ ---> show hard disk
/dev/sdb/---> show external pendrive
so i want to know how to check available space using QStorageInfo ?
-
i need to find available space on attached pen drive. how i can do that ?
because i am getting 2 storage device
i.e.
/dev/sda/ ---> show hard disk
/dev/sdb/---> show external pendrive
so i want to know how to check available space using QStorageInfo ?
i have seen that there is when attach pen drive. we can get path of that pendrive using df -h then we can pass path of that pendrive like below to get the available space on that pen drive
QString str = List.at(0); const QString Path = "/media/embeddedDeveloper/4AFB-18C7"; QStorageInfo storage(Path); qDebug() << "fileSystemType:" << storage.fileSystemType(); qDebug() << "size:" << storage.bytesTotal()/1000/1000 << "MB"; qDebug() << "availableSize:" << storage.bytesAvailable()/1000/1000 << "MB";