This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
filename from fstream object
- From: Bernd Speiser <bernd dot speiser at uni-tuebingen dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 07 Jan 2003 17:39:06 +0100
- Subject: filename from fstream object
- Organization: Univ. Tuebingen, Inst. f. Organische Chemie
- Reply-to: bernd dot speiser at uni-tuebingen dot de
Hi,
I'm creating an ifstream object successfully, I can open it and read from
the corresponding file.
Now I have the problem that the object (rather a reference to it) is given
to a routine, which wants to do some manipulations on the name of the file
associated with the ifstream. Really, it wants to open an ofstream object
who's name is somehow related to that of the ifstream-filename.
I checked several pieces of documentation, but could not find a solution
to the problem how to retrieve the file name from the ifstream object. Is
this at all possible? Ok, I could always give the filename string as another
parameter to my routine, but I would rather avoid this to keep the interface
clean.
Any help is appreciated, even negative answers, since in the latter case, I know
that I have to go to the unwanted alternative. Thanks.
Bernd
--
=======================================================================
Bernd Speiser
Institut f"ur Organische Chemie
Auf der Morgenstelle 18
D-72076 T"ubingen
Germany
phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory)
fax: +49-7071-295518 (new!)
e-mail: bernd.speiser@uni-tuebingen.de
Internet: http://www.uni-tuebingen.de/speiser
=======================================================================