remove() capability in fstream class/templates?

M

Matt

Hello,

I would like to be able to delete (as in stdio.h remove()) fstream
objects. Is there a means for me to do this in C++? I see no such
capability in my references.

remove() is not so bad, except for the fact that I need to keep track
of a file's associated name in addition to it's fstream reference (I'm
presuming that fstream can not give me the filename, don't see a
reference to this either, please correct me if necessary) in order to
remove()/delete the file.

-Matt
 
V

Victor Bazarov

Matt said:
I would like to be able to delete (as in stdio.h remove()) fstream
objects. Is there a means for me to do this in C++? I see no such
capability in my references.

remove() is not so bad, except for the fact that I need to keep track
of a file's associated name in addition to it's fstream reference (I'm
presuming that fstream can not give me the filename, don't see a
reference to this either, please correct me if necessary) in order to
remove()/delete the file.

There is no such functionality (neither in C nor in C++). If you need
to delete (remove) a file from your file system, you have to know what
name it has and then use 'remove' or whatever other means your platform
provides.

V
 

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

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,190
Latest member
Martindap

Latest Threads

Top