Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to check available space on attached pendrive in qt ?

How to check available space on attached pendrive in qt ?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 1 Posters 262 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by
    #1

    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 ?

    Q 1 Reply Last reply
    0
    • Q Qt embedded developer

      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 ?

      Q Offline
      Q Offline
      Qt embedded developer
      wrote on last edited by Qt embedded developer
      #2

      @Qt-embedded-developer

      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";
                     
      
      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved