Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 196
Registered: ‎12-14-2009
My Device: Not Specified

Folder Permissions

I noticed at times folders created by my app using the picker will be such that files my app makes/wants-to-make will not write or the won't be read by my app.

 

I have another app by another developer that is cascades and has a function to fix folder permissions. I ran it on the folders my app made and it fixed the read/write problems.

 

Can anyone point me in the right direction to fix folder permissions? I suppose it is qt cpp code. Any help is appreciated.

BlackBerry Development Advisor
Posts: 143
Registered: ‎03-08-2012
My Device: Z10
My Carrier: Bell

Re: Folder Permissions

Hi.

 

If you use QDir to create folders as part of app initialization, it sets the correct permissions.  Not sure exactly what the other developers code uses exactly but I would suggesting checking the reference documentation for QDir, QFile and QFileInfo and I suspect that you wlll find a function for checking and updating permissions.

Retired
Posts: 83
Registered: ‎10-10-2012
My Device: Z30
My Carrier: Bell
Developer
Posts: 196
Registered: ‎12-14-2009
My Device: Not Specified

Re: Folder Permissions

[ Edited ]

The user uses the OS FilePicker to create any folders so it's not my app that does it. The user only chooses a folder in which to save files that will be placed in said folder. It only happens on SD Card folder-saves.

Does anyone know if there are issues with inodes when using a Media Card on BB10?

http://stackoverflow.com/questions/12322813/android-filesystem-and-inodes

 

as to garydev: I have all the shared permissions granted.

BlackBerry Development Advisor
Posts: 143
Registered: ‎03-08-2012
My Device: Z10
My Carrier: Bell

Re: Folder Permissions

Hi.

 

QFileInfo has a couple of methods for checking / testing permissions although I don't see a mechanism for changing them.  Start from there:

 

https://developer.blackberry.com/native/reference/cascades/qfileinfo.html#permission

 

and see if that leads you to a good solution. 

 

I am concerned that you could create a folder with the FilePicker that has the wrong permissions.  This sounds like a bug or potentially could be a result of a hardware issue with your particular SD card.  I recommend testing with another SD card to see if the same thing occurs and if so, file a bug on the issue tracker so that we can get the dev teams to investigate.

 

Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Folder Permissions

[ Edited ]

Changing them is on QFile.

http://qt-project.org/doc/qt-4.8/qfile.html#setPermissions

--
Rob is no longer associated with BlackBerry.