How to get format details of a drive in Qt
-
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 :)
-
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] -
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] -
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.
-
try #include <QtSystemInfo>