how to manage temporary files in C ?

D

Duff

Hi all,

i'd like to use several temporary files in my current C-project. I already
tried to use "mkstemp" and "tempnam" functions. The problem is that my
compiler warned me about the use of "tempnam" which seems to be dangerous...
could someone help me with giving me pieces of advice concerning the use of
temporary files in C ?

Thanks a lot
Duff
 
M

Mike Wahler

Duff said:
Hi all,

i'd like to use several temporary files in my current C-project. I already
tried to use "mkstemp" and "tempnam" functions. The problem is that my
compiler warned me about the use of "tempnam" which seems to be
dangerous...

I don't know about 'dangerous', but the 'problem' is that neither
of 'mkstemp' or 'tempnam' are standard C functions, so not topical
here.
could someone help me with giving me pieces of advice concerning the use of
temporary files in C ?

See the standard functions 'tmpfile()' and 'tmpnam()', declared by <stdio.h>

If you get stuck, post your code and ask specific questions.

-Mike
 

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
474,139
Messages
2,570,805
Members
47,352
Latest member
DianeKulik

Latest Threads

Top