Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to get format details of a drive in Qt
QtWS25 Last Chance

How to get format details of a drive in Qt

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 2.4k 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.
  • S Offline
    S Offline
    Stoned Jesus
    wrote on last edited by
    #1

    I am working on an app where I need to display the file format of a drive(NTFS or FAT32). Now I did a little research and found that there is no Qt API which can make it easy for me to grab the format detail. So I came across a windows API which made it possible for me to get the format detail when I connect the drive(External or Internal) and run the application on windows. Here is the code:

    @TCHAR volumeName[MAX_PATH + 1] = { 0 };
    TCHAR fileSystemName[MAX_PATH + 1] = { 0 };
    DWORD serialNumber = 0;
    DWORD maxComponentLen = 0;
    DWORD fileSystemFlags = 0;

    LPCWSTR path = deviceData->m_strPath.utf16(); //deviceData->m_strpath gives me the drive path

    if (GetVolumeInformation(
    path,
    volumeName,
    ARRAYSIZE(volumeName),
    &serialNumber,
    &maxComponentLen,
    &fileSystemFlags,
    fileSystemName,
    ARRAYSIZE(fileSystemName)))
    {
    newData.strFileSystem = QString::fromUtf16(fileSystemName);
    }

    QList m_SDInfoList;
    m_SDInfoList.append(newData);@
    

    Is there a way I can get the same Format detail when I run my Qt app in MAC operating system? A MAC API that can help me to get the file format. Please help :)

    --
    Thanks & Regards,
    Stoned Jesus

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Please search the archives. This has been discussed already very recently.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Stoned Jesus
        wrote on last edited by
        #3

        Thank you Andre. Can you please help me to find the post about this file format??
        [quote author="Andre" date="1364557720"]Please search the archives. This has been discussed already very recently.[/quote]

        --
        Thanks & Regards,
        Stoned Jesus

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          After just two minutes you give up trying to search, even though you know there is something to find? Come on... Do a bit of effort yourself.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Stoned Jesus
            wrote on last edited by
            #5

            Well I am searching. It's not that I gave up. Anyway I will continue to search and If I cant find ill drop a post. Thank you :)
            [quote author="Andre" date="1364557982"]After just two minutes you give up trying to search, even though you know there is something to find? Come on... Do a bit of effort yourself.[/quote]

            --
            Thanks & Regards,
            Stoned Jesus

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              Are you kidding me? I searched for a minute or two, and found out that it was actually your "thread":http://qt-project.org/forums/viewthread/25629 discussing this.

              1 Reply Last reply
              0
              • V Offline
                V Offline
                vittalonline
                wrote on last edited by
                #7

                try #include <QtSystemInfo>

                1 Reply Last reply
                0

                • Login

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