[Interest] QDir().rename() or QFile::rename() on Android 11

maitai maitai at virtual-winds.org
Mon Oct 25 14:37:06 CEST 2021


Hi,

I need to move globally one folder to another in 
/Android/Data/myapp/files.

App is built against SDK29, and I do have 
android:requestLegacyExternalStorage="true" in the manifest.

I am using QFile::rename, or QDir().rename() with same bad result when 
running Android 11. There is no issue with existing original folder and 
not existing destination folder (i.e original folder exists and is 
readable, destination folder does not exists but it's parent exists and 
I can create files and folders in it).

It works perfectly on Android 9 (cannot test on Android 10), but fails 
miserably on Android 11.

I also tried directly via Java with File.renameTo or Files.move no luck.

Any hint welcomed, thanks in advance.

--Philippe Lelong


More information about the Interest mailing list