how to open a file in symbian 3rd edition

Login to reply to this topic.
Thu, 2007-10-04 11:24
Joined: 2006-12-18
Forum posts: 42

hi friends,

I wanna open a file in write mode. Initially there is no file on that path.

p_log_file_ptr = icf_port_fopen("\\resource\\apps\\icf_logs.txt", "w+" );

fopen but it doesn't open the file .
So i explicitly copied the file on device by give it in pkg file.

"\Symbian\9.2\S60_3rd_FP1\Epoc32\winscw\c\icf_logs.txt"
-"!:\resource\apps\icf_logs.txt"

Now the file is there but can't be written ............................
Could anybodey tell me the reason and correct me if i m wrong anywhere.


Thu, 2007-10-04 11:43
Joined: 2004-05-21
Forum posts: 286
Re: how to open a file in symbian 3rd edition

All files under \Resource are readonly untill unless it has TCB capability. Why dont you move them to app's private directory?

Cheers,
Sri

Thu, 2007-10-04 11:53
Joined: 2006-12-18
Forum posts: 42
Re: how to open a file in symbian 3rd edition

Hi friend,
First of all i put all the files in
p_log_file_ptr = icf_port_fopen("\\private\\280000A6\\icf_logs.txt", "w+" );
My application is consoled based and i want to see the log file.
I downloaded fileexplorer for that and make on copy of EXE in resource\apps folder.
I can run the EXE.

But Fileexplorer has not access to private directory . so i can't checks the logs.

Can u give me any pyher fruitful solution.

Thu, 2007-10-04 12:04
Joined: 2004-05-21
Forum posts: 286
Re: how to open a file in symbian 3rd edition

What is icf_port_fopen? why are u not using RFile? If it ported from C then why are you not using fopen? If you not want to waste much time finding the solution of doing that way what you can do is after you are done with loggin copy the file in to some public folder. By this you can view from some external file viewer or copy in to system to view.

Cheers,
Sri

Thu, 2007-10-04 12:40
Joined: 2004-11-29
Forum posts: 1232
Re: how to open a file in symbian 3rd edition

You should be able to create files in the root folder of c:\ without any special capabilities.
Looks like you are doing that on the emulator, why not do this also on target?

srikanth:
I think he is trying to port code written to be portable, that have wrapper functions for all "external" functions.
A common solution to keep all integration code in the same place.
His module obviously is named something with "icf" (judging from the log name) and "icf_port_" sounds like a good prefix for such wrapper functions Smiling

Fri, 2007-10-05 07:08
Joined: 2006-09-18
Forum posts: 68
Re: how to open a file in symbian 3rd edition

I usually use C:\Data for log files, because that is point where the Symbian File Manager has access, of course that is only a plus for small programs with little log output. With large ones you like to have a PC screen to view them. And the PC has access to C:\

  • Login to reply to this topic.