I'm deploying an iphone application through QtCreator. I'd like to create a simple file using standard C++ libraries. I try to do this in the sandbox Documents folder.
I compiled boost, so I use this library to check if the sandbox Document folder exists.
My application starts in /private/var/mobile/Containers/Bundle/Application/<UUID>/<application name>.app. Then, I simply try to access /private/var/mobile/Containers/Bundle/Application/<UUID>/<application name>.app/../Documents folder (using boost::filesystem::is_directorty), as it does not exist, I try to create it (using boost::filesystem::create_directories), but it fails (boost raises an exception).
Am I doing it wrong? Am I not in the right PATH? Or do I have to set any special permission to my app in order to be able to do this (as for Android, I add to list EXTERNAL_STORAGE in my application manifest).
My path for documents was wrong. Could find the good one using Qt API:
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
This returns:
/var/mobile/Containers/Data/Application/<another UUID>/Documents
(different than what I was trying to access in /private/var/mobile/Containers/Bundle/Application)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With