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
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: Created files are read only and invisible

Doesn't Marmelade allow to use Native C API?

Contributor
mita
Posts: 13
Registered: ‎06-29-2013
My Device: dev alpha B

Re: Created files are read only and invisible

Thanks you all.

 

umask didn't help and calling things using system didn't either.

I also tried to change mode using ssh but only got "operation not permitted".

umask in ssh did accept changes but didn;t help at all.

 

And yes, Marmalade is supposed to give native api, which what I;m using. It just doesn't work.

 

I opened a case with them, but I'm not counting on a fast solution - they just released a new version of the sdk.

 

 

Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Created files are read only and invisible

Did you call umask just to see what value it returns? That should help, at least in terms of pointing to that as the underlying cause (if it is).

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Contributor
mita
Posts: 13
Registered: ‎06-29-2013
My Device: dev alpha B

Re: Created files are read only and invisible

yes. it returns 022. after i set it to 000 it returns 000.

Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Created files are read only and invisible

Interesting that it's different than I get here. Also interesting that it seems that would affect only the group and other "w" bits, but not account for the missing read bits.

I take it after changing it like that, and attempting to create a new file, you see no changes in behaviour? Is that what you meant by "didn't help"?

What if you try umask(0777) first? Does that result in all those bits being cleared? (At least it would show that the umask mask is involved to some extent.)

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: Created files are read only and invisible

Here is a program:

#include <stdio.h>

int main(int argc, char **argv)
{
	FILE *fp = fopen("./shared/misc/testfolder/testfile", "wb");

	fwrite("testtesttest", 1, 10, fp);

	fclose(fp);
	return 0;
}

 That creates testfile, that can be seen via file manager, from PC and can be attached to e-mail.

$ ls -l ../../shared/misc/testfolder/
total 1
-rw-rw-rw-   1 devuser   1000_shared        10 Jul 04 19:55 testfile

 

Contributor
mita
Posts: 13
Registered: ‎06-29-2013
My Device: dev alpha B

Re: Created files are read only and invisible

Right, except this code doesn't create the same permissions when compiled with Marmalade. My code was almost identical except the access to the shared folder is with "raw://" and not "./".

 

Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: Created files are read only and invisible

I don't understand how your app can behave differently. Marmelade is just an IDE and set of libraries (right?) If you do standard C function call, your app calls this function using standard C library - nothing to do with Marmelades. And even if Marmelades changes umask for your app you should be able to change it back to needed values again just by means of standard libraries.

Please let us know what Marmelade's team says about this problem.

Contributor
mita
Posts: 13
Registered: ‎06-29-2013
My Device: dev alpha B

Re: Created files are read only and invisible

I will.

 

It now seems I'm not the only one with this problem, so I hope for an answer soon.