Page 1 of 1

Open file problem

PostPosted: Jan 24, 2007 @ 4:53am
by patrickwai
I use the follow codes to open file in Symbian 9.1 device (N80):

bool retValue = false;

char filename[100] = {0};

m_pECD->std->StrCpy(filename, m_pECD->dat->currentpath);
m_pECD->std->StrCat(filename, "<FILENAME>.txt");

retValue = m_pECD->file->Open(filename, EFOF_READ);

where "m_pECD" is a "ECD" variable. The file opened successfully in Symbian 7.0 device (3230) but return "0" in N80. Is there any problem about the reference code? I'm using Symbian 6.1 and Symbian 9.1 SDK.

Thanks~

PostPosted: Jan 24, 2007 @ 9:22am
by edge

PostPosted: Jan 24, 2007 @ 9:54am
by patrickwai
I'm using a .pkg file and here is the content:

{
&EN

#{"MyCode"},(0xF020789F),1,0,0

%{"Vendor-EN"}
:"Vendor"

[0x101F7961], 0, 0, 0, {"S60ProductID"}

"\Symbian\9.1\S60_3rd\epoc32\release\gcce\urel\MyCode.exe"-"!:\sys\bin\MyCode.exe"
"\Symbian\9.1\S60_3rd\Epoc32\Data\z\resource\apps\MyCode.rsc"-"!:\resource\apps\MyCode.rsc"
"\Symbian\9.1\S60_3rd\Epoc32\Data\z\private\10003a3f\import\apps\MyCode_reg.rsc"-"!:\private\10003a3f\import\apps\MyCode_reg.rsc"
"MyCode_aif.mbm"-"!:\resource\apps\MyCode_aif.mbm"
"..\res\Game.txt"-"!:\system\apps\MyCode\Game.txt"
"..\res\m.dat"-"!:\system\apps\MyCode\m.dat"
"..\res\w.dat"-"!:\system\apps\MyCode\w.dat"
"..\res\u.dat"-"!:\system\apps\MyCode\u.dat"
}

The Game.txt is placed in \res.

PostPosted: Jan 24, 2007 @ 10:11am
by edge
Hi Patrick,

The problem is that your textfile is installed in the wrong folder. For Symbian 9, the data files must be installed in a private folder belonging to your application.

Change the installation locations of game.txt, m.dat, w.dat and u.dat. Here is an example where game.txt should be installed:
"..\res\Game.txt"-"!:\private\F020789F\Game.txt"

The folder F020789F is the same as your application UID.