Connecting Tech Pros Worldwide Forums | Help | Site Map

remove() capability in fstream class/templates?

Matt
Guest
 
Posts: n/a
#1: Jul 23 '05
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
--
Remove the "downwithspammers-" text to email me.

Victor Bazarov
Guest
 
Posts: n/a
#2: Jul 23 '05

re: remove() capability in fstream class/templates?


"Matt" <matt@downwithspammers-mengland.net> wrote...[color=blue]
> 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.[/color]

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


Closed Thread


Similar C / C++ bytes