get filename from ifstream?

  • Thread starter Thomas Schaefer
  • Start date
T

Thomas Schaefer

Hi all,

I have a rather uncommon problem: I get an ifstream but I don't know the
name of the file connected to this ifstream.

Is there any way to get the file name out of an ifstream?

TIA
Thomas
 
M

Mike Wahler

Thomas Schaefer said:
Hi all,

I have a rather uncommon problem: I get an ifstream but I don't know the
name of the file connected to this ifstream.

Is there any way to get the file name out of an ifstream?

No there is not. But in order to open the file, you
had to supply the name. Just save that.

-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

Similar Threads

ifstream >> string??? 1
how to print a filename from ifstream? 10
multi-thread and ifstream 1
ifstream 5
ifstream errors 15
Deriving from ifstream 3
Error with ifstream and exceptions 71
ifstream speed 3

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top