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

QFileInfo::isSymLink() returns true with wrong path

XMLWordPrintable

    • Windows
    • 329b05739 (dev), 23cf29ffd (6.8), de6a28f04 (6.7), 1fdd53195 (tqtc/lts-6.5)

      Strangely QFileinfo::isSymLink() seems like only checks if the file name has  .lnk , this does not seems to be checking if path really exists or file really there. 

      QString symlinkPath = "blablabla\\multipage.lnk";
          QFileInfo symlinkInfo(symlinkPath);
      if (symlinkInfo.isSymLink())
      {
      qDebug() << "The symlink file itself exists.";
      }
      else
      {
      qDebug() << "The symlink file does not exist.";
      } 

      This will return true and you will get ouput

      "The symlink file itself exists."

      Fact is the path is just garbage.

      Also there does not seems any way to check if given symlink file exists or not irrespective if Target of symlink exists or not.

        For Gerrit Dashboard: QTBUG-128800
        # Subject Branch Project Status CR V

            thiago Thiago Macieira
            irfan.omair@digia.com Irfan Omair
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: