Get Current App Path

Login to reply to this topic.
Mon, 2005-11-21 15:37
Joined: 2005-08-09
Forum posts: 29
Hi,

How can i get running application path (from within that app).

Mon, 2005-11-21 15:48
Joined: 2004-05-20
Forum posts: 22
Re: Get Current App Path
CEikApplicaiton::AppFullName()
Mon, 2005-11-21 18:01
Joined: 2005-08-09
Forum posts: 29
Re: Get Current App Path
Tnx,

It worked , but i have problem creating file in current folder on emulator because disk "Z" is read only, my application creates and writes to files, and i like to have that files in subdir of application directory, how can i set CodeWarrior to transfer my application to drive "C" on emulator instead of "Z" after compilation. On real device it works ok. Is there some pkg file that CW use to copy files to emulator or Huh

Is it ok to have fixed paths in app.  , is it usual on Symbian phones to copy application folder in different drive (folder) and expect it to work?  or it is bather to have all paths dynamicly created  from   "CEikApplicaiton::AppFullName()"
Tue, 2005-11-22 21:06
Joined: 2005-11-20
Forum posts: 1242
Re: Get Current App Path
As for the different drives: Well, as soon as you have a phone with more than one drive, e.g. like my P900 with the memory stick as a second drive D:, the installer gives the user the free choice of drives. If I use this free choice, choose D:, but the application does not work because C: is hardcoded, I as a user would consider this a bug.

As for the Z: drive problem: You may have your reasons why you want your application to create files in a subdir of the application directory, but this is not the recommended "Symbian" way of doing it, and I think if you stick with this, in the long run you will run into all kind of troubles, not only this first problem of your application going to the emulator read-only Z drive (for which I don't know a solution, anyway).

René Brunner

Wed, 2005-11-23 11:29
Joined: 2005-08-09
Forum posts: 29
Re: Get Current App Path
Quote
You may have your reasons why you want your application to create files in a subdir of the application directory, but this is not the recommended "Symbian" way of doing it

What is recommended "Symbian" way? In others platforms it is usual that if you have some files for example game tables , saves , data  all that files go to application directory or subdirectory.
Wed, 2005-11-23 18:08
Joined: 2005-11-20
Forum posts: 1242
Re: Get Current App Path
Each application gets a default document directory, for an application called "Test" this will be C:\System\APPS\Test.

In the simple case where your application only has some simple data to load at startup and write back after modification only the following is necessary: Give a file name in the .rss file, e.g. RESOURCE TBUF { buf="TestConfig"; }, and then write InternalizeL and Externalize methods for the Document class.

Everything else is automatic: The application framework will create the directory C:\System\APPS for you, if it does not yet exist, will create a file "TestConfig" there for you, will open it, call your InternalizeL method at program startup, etc.

For more complicated cases probably this code can give quite some hints how to manage multiple documents:
http://discussion.forum.nokia.com/forum/showthread.php?t=3995

René Brunner

Fri, 2005-11-25 11:10
Joined: 2005-11-20
Forum posts: 1242
Re: Get Current App Path
Quote
Each application gets a default document directory, for an application called "Test" this will be C:\System\APPS\Test.

Ops... the document directory will be C:\Documents\Test of course...

René Brunner

  • Login to reply to this topic.