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

QFile, data loss with OneDrive Virtual files (CloudFilterApi files)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.7, 6.4.0
    • Core: I/O
    • None
    • Windows

    Description

      When a a virtual file provider (https://learn.microsoft.com/en-us/windows/win32/api/_cloudapi/) reports an error on a virtual file, the error is ignored by QFile.

      File operations like open, read and write succeed, no error is reported.

      Read operations always return an empty byte array.

      Writes succeed, the underlying file is however not actually changed which results in data loss.

      When using Windows native commands like CreateFile, ReadFile and WriteFile, the operation fails and reports "The cloud operation was unsuccessful.".

       

      Attached to the issue you will find a patch for the Microsofts CloudMirror example https://learn.microsoft.com/en-us/samples/microsoft/windows-classic-samples/cloudmirror-sample/ ,  with the patch applied the example will provide an `STATUS_CLOUD_FILE_UNSUCCESSFUL` error for all files.

      Additionally I attached an example application that demonstrates the the behavior of QFile vs Windows native file commands.

      • Follow the instructions provided by Microsoft and compile the CloudMirror example
      • The CloudMirror example will ask you for a src and a dest directory
      • Create a file in the src location
      • Copy the dest file path to the `fileName` variable in the attached demonstrator src
      • Run the demonstrator

       

      Attachments

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

        Activity

          People

            cnn Qt Core & Network
            theonering Hannah von Reth
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes