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
Super Contributor
lyon819
Posts: 253
Registered: ‎08-19-2010
My Device: BB10, Playbook, 9900, 9800, 9700, 9550, 9530, 9500, 8700.
Accepted Solution

Try to save a text to a file, but the file path or directory might be wrong.

Could anyone help me to check the file_path, which is correct or not?

                         FILE* f= fopen("/shared/documents/save.dat", "wb");
                           if(f==NULL){
                             fprintf(stderr,"Cannot create output.txt\n");
                             _exit(1);
                           }
                           fprintf(f,"Hello World!");

 

The result always show f == NULL.

 

-Fight with BB10
BlackBerry Development Advisor
elena_laskavaia
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: Try to save a text to a file, but the file path or directory might be wrong.

Remove leading /, i.e."shared/documents/save.dat" and you need to have access_shared action declared