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

CLONE - QFile does not provide ways of working with symlink files

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P2: Important
    • Some future release
    • 4.8.7, 5.5.1
    • Core: I/O
    • None
    • Unix

    Description

      ---- CLONED ISSUE ----

      ---- Original text ----
      On Qt for Mac and Linux:

      When a QFileInfo points to a symlink file, the method calls performed on the QFile object point to the target. There is no way to operate on the symlink file itself.

      It would be nice if QFile and QFileInfo provided a way to operate on the symlink file instead of the target.

      ---- Comments by me ----
      I am cloning this bug report from QTBUG-3036 since I think that the issue should be re-evaluated, and nobody pointed to an existing alternative in my forum post (https://forum.qt.io/topic/62034/get-size-of-symbolic-links-symlinks), so I assume that it doesn't exist yet.

      My comments on the topic are these:

      • Currently seems to be impossible to copy symbolic links as-is (ie. maintaining their "relativeness"), because QFile::symLinkTarget and QFileInfo::symLinkTarget always return an absolute path.
      • Also it seems impossible to measure size of symbolic links, because all QFile functions operate on the pointed-to file (imagine wanting to create a downloadable file with 1 MB file + 100 symlinks; it's not correct to calculate the size as 100MB!). This specific problem has been treated earlier here: QTBUG-24831 (although related to Windows) and here: QTIFW-137 (where it seems that the Qt Installer Framework people had to resort to implement a custom function to overcome the problem).

      I know this topic has been discussed since at least as early as 2009, but I couldn't find any conclusion or definitive decision about it
      http://www.archivum.info/qt-interest@trolltech.com/2009-07/00036/(Qt-interest)-Symbolic-link-real-value.html

      Attachments

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

        Activity

          People

            stormols Marius Storm-Olsen
            oneorjuan Juan Navarro
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes