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

QTemporaryFile Behaves Differently on Windows and Elsewhere

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.8.6
    • None

      We have run into an issue on LyX due to the fact that QTemporaryFile seems to behave differently on Windows and elsewhere. When we save a file (in the 2.2dev version), we write it to a temporary file and then rename that, if it works, thus preserving the original file if it fails. This works fine on Linux, at least, but on Windows the renaming fails.

      This looks to be a version of QTBUG-10856 and/or QTBUG-13388, which were said not to be bugs, but the issue here is different: The renaming seems to work fine on Linux, but not on Windows.

      I note, by the way, that at the end of the former bug report, João Abecasis said: "What you can do is create the temporary file, write to it, and then rename it to some more definitive name. At that point, you should call setAutoRemove(false) to make sure you won't attempt to delete this file." That is exactly what one cannot do on Windows.

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

            w00t Robin Burchell
            rgheck@lyx.org Richard Heck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes