Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Problems reading/writing to files

3 replies · 1,526 views · Started 09 July 2004

Hi, I recently downloaded some sample Series 60 applications by Nokia, more specifically the "Elements" project. Anyway, i'm running the app on the Metroworks Codewarrior emulator and it tosses an error when trying to read from a file.
The file is defined in the elementsengine.cpp by a string literal

_LIT(KMetalsFileName, "C:\\Symbian\\metals.csv"😉

and I have double checked that this is the correct pathname, but it still hangs when it trys to read the file from that location. Am I wrong to assume the path should have two backslashes? I tried one backslash and ran the debugger and the value for the literal removed the single backslash.

So my question is, has anyone ran this sample application with success? I'm trying to learn how to read/write to files using Symbian with this application, so any help would be great. One backslash, or two? Thanks in advance!

Hi Friend,

I guess theres no need for path if the file exists in the same directory.
Why dont u try without one?
It worked for me.

_LIT(KFileName,"file.ini"😉;

Regards,
Dhans

thanks for the help. apparently, the "c:\" is actually imbedded in one of the sdk's folders marked winscw (i'm using codewarrior as my IDE).

but now the problem is configuring the ELements program so i can perform functions such as WRITE to file. right now, it reads in the data and then closes the emulator. Any tips?