title: How to check whether inserted SD Card is write protected or not in Qt?
body: <p>Hi friends I am working on an application where I should check the file system of the SD card and also I need to check whether the SD card inserted is write protected or not. I was successful in getting the file system details as follows:</p>
  
  <pre><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-&gt;m_strPath.utf16(); // deviceData gives me the path of the SD Card
  
  // Get the file system details
  if (GetVolumeInformation(
                           path,
                           volumeName,
                           ARRAYSIZE(volumeName),
                           &amp;serialNumber,
                           &amp;maxComponentLen,
                           &amp;fileSystemFlags,
                           fileSystemName,
                           ARRAYSIZE(fileSystemName)))
              {
                  newData.strFileSystem = QString::fromUtf16(fileSystemName);                
              }
  
   m_SDInfoList.append(newData); // m_SDInfoList is QList
  </code></pre>
  
  <p>With this approach I get to know whether the file system is FAT32 or NTFS. Now I want to achieve the write protected details. Is their a Qt API that can gimme whether the inserted SD Card is write protected or not??? Please help :)</p>
  
  <p><strong>Update:</strong></p>
  
  <p>This is what I did using QFileInfo:</p>
  
  <pre><code>QFileInfo fileInfo(deviceData-&gt;m_strPath);                    
  
  if(!fileInfo.isWritable())
  {                        
         newData.strStatus = "WriteProtect Enabled";
  }
  else
  {
         newData.strStatus = "WriteProtect Disabled";
  }
  </code></pre>
  
  <p>It always ends up giving me WriteProtect Disable even though I have set the write protected permission. </p>