_tfopen()

G

grubbymaster

Hi

I'm building an application for Pocket PC's , and i want to save data
in a file in a specified path.I'm saving the file like this FILE *f =
_tfopen(TEXT("profiles.txt"),TEXT("a"));Can someone provide a method or

aexample on how to specify a certain path , like for example :
"\Program Files\MyApp".I've tried FILE *f = _tfopen(TEXT("\\Program
FIles\\MyApp\\profiles.txt"),TEXT("a")); and it didn't work.


10x
 
K

Keith Thompson

grubbymaster said:
I'm building an application for Pocket PC's , and i want to save data
in a file in a specified path.I'm saving the file like this FILE *f =
_tfopen(TEXT("profiles.txt"),TEXT("a"));Can someone provide a method or

aexample on how to specify a certain path , like for example :
"\Program Files\MyApp".I've tried FILE *f = _tfopen(TEXT("\\Program
FIles\\MyApp\\profiles.txt"),TEXT("a")); and it didn't work.

The correct way to represent
\Program Files\MyApp\profiles.txt
as a C string literal is
"\\Program Files\\MyApp\\profiles.txt"

Beyond that, I don't think we can help you here. There's no _tfopen()
or TEXT() function in standard C. You'll need to ask in a forum
appropriate for your platform. There seems to be a newsgroup called
"microsoft.public.pocketpc.developer", but I don't know anything about
it.
 
R

Robin Haigh

grubbymaster said:
Hi

I'm building an application for Pocket PC's , and i want to save data
in a file in a specified path.I'm saving the file like this FILE *f =
_tfopen(TEXT("profiles.txt"),TEXT("a"));Can someone provide a method or

aexample on how to specify a certain path , like for example :
"\Program Files\MyApp".I've tried FILE *f = _tfopen(TEXT("\\Program
FIles\\MyApp\\profiles.txt"),TEXT("a")); and it didn't work.

(slightly on-topic as the same issues can arise with fopen on any platform)

-- most implementations of fopen won't create directories that don't exist
(seems unlikely to be the problem here)

-- you haven't got another instance of the program lying around holding the
file open? (More generally, do you know if it's a namespace issue or a
file-access issue?)
 
K

Kenny McCormack

Hi

I'm building an application for Pocket PC's , and i want to save data
in a file in a specified path.I'm saving the file like this FILE *f =
_tfopen(TEXT("profiles.txt"),TEXT("a"));Can someone provide a method or

aexample on how to specify a certain path , like for example :
"\Program Files\MyApp".I've tried FILE *f = _tfopen(TEXT("\\Program
FIles\\MyApp\\profiles.txt"),TEXT("a")); and it didn't work.

Allow me to be the first to say this - and I say it from the deepness of my
heart, with all the kindness and love one has come to associate with the
helpful posts you get in this newsgroup:

Not portable. Can't discuss it here. Blah, blah, blah.

They'll slam u 4 ths.
 
G

Grumble

Kenny McCormack wrote for the 82,637th time:
Allow me to be the first to say this - and I say it from the deepness of my
heart, with all the kindness and love one has come to associate with the
helpful posts you get in this newsgroup:

Not portable. Can't discuss it here. Blah, blah, blah.

My dear, dear Kenny, allow me to be the first to say this, and I say
it from the deepness of my heart, with all the kindness and love et
caetera, you sound like bitterness incarnate.
They'll slam u 4 ths.

Now *that* is funny.
 
K

Kenny McCormack

Grumble said:
Kenny McCormack wrote for the 82,637th time:
[snip]

Please don't feed the troll.

Please don't feed the "regular".

Seriously, guy, if they are amused by what I write, why should you piss on
their cornflakes?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top