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. QFileInfo("<CD-ROM letter>").isReadable() can cause a "No disk" error on Windows. Bug or not?
Forum Updated to NodeBB v4.3 + New Features

QFileInfo("<CD-ROM letter>").isReadable() can cause a "No disk" error on Windows. Bug or not?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.1k Views 1 Watching
  • 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.
  • V Offline
    V Offline
    Violet Giraffe
    wrote on last edited by
    #1

    At the moment, when I do QFileInfo("L:/").isReadable(), where L is my DVD-ROM drive letter, I get the error:


    File Commander: FileCommander.exe - No Disk

    There is no disk in the drive. Please insert a disk into drive L:.

    Cancel Try Again Continue

    what my app is doing is it enumerates disks on timer in a worker thread to watch for changes. So I get this message over and over again. Can this be solved? Is it a Qt bug?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      Violet Giraffe
      wrote on last edited by
      #2

      Edited the question. It's QFileInfo::isReadable() that causes the trouble, not a constructor.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        AFAIK, Qt's innocent. You'll get the same error message from e.g. explorer if you try to access an empty cd or floppy drive.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • V Offline
          V Offline
          Violet Giraffe
          wrote on last edited by
          #4

          [quote author="SGaist" date="1412453207"]Hi,

          You'll get the same error message from e.g. explorer if you try to access an empty cd or floppy drive.[/quote]
          Not so!
          I believe it's a matter of carefully choosing which WinAPI functions to call first (ones that are safe from this error), checking their result and deciding whether or not it is safe to query for further drive / file / folder stats with those API functions that might result in this error.
          It is true that many programs that are not written carefully enough will cause this error. If it wasn't for a very unlikely coincidence, I wouldn't know my program triggers the error either.

          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