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

QFileInfo::isSymLink() returns true with wrong path

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews