Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-40980

QStorageInfo on Windows: fileSystemType does not distinguish network drives

    XMLWordPrintable

Details

    Description

      If you mount a network drive on Linux, the type may be nfs or cifs (or others).

      If you mount a Windows drive on OS X, the type is smbfs.

      If you mount a Windows remote drive on Windows, the type is ntfs. This is not right because it doesn't allow users to distinguish network from local drives. It should be smb or cifs or something like that. To make it worse, if I share a drive from OS X (using SMB) and mount that on Windows, it still says ntfs, although the remote filesystem type is actually HFS. It's not a good cross-platform API if we can't make it behave consistently.

      If getting the name of the remote-mounting protocol is not possible, then putting back some sort of flag to indicate that the drive is a network volume might be adequate for some use cases. This flag was already in place in earlier versions of what ended up as QStorageInfo.
      (using Win32API GetDriveType()/ DRIVE_REMOTE), current code: qtbase\src\corelib\io\qstorageinfo_win.cpp:137 . Note that GetDriveType() is already called at to get the device name in getDevice() at qtbase\src\corelib\io\qstorageinfo_win.cpp:76 .

      See https://codereview.qt-project.org/#/c/73945/41/src/corelib/io/qvolumeinfo.h https://codereview.qt-project.org/#/c/73945/41/src/corelib/io/qvolumeinfo_win.cpp and https://codereview.qt-project.org/#/c/73945/41/src/corelib/io/qvolumeinfo_unix.cpp

      # 3 : QStorageInfo("name", rootPath="X:\", device="\\...\...\", fileSystemType=NTFS, [ready], bytesTotal=..., bytesFree=..., bytesAvailable=..., blockSize=-1)
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes