get filename from ifstream?

Discussion in 'C++' started by Thomas Schaefer, May 7, 2004.

  1. 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
     
    Thomas Schaefer, May 7, 2004
    #1
    1. Advertising

  2. Thomas Schaefer

    Mike Wahler Guest

    "Thomas Schaefer" <> wrote in message
    news:...
    > 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
     
    Mike Wahler, May 7, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Sm9l?=

    Extract filename from a filename typed by user

    =?Utf-8?B?Sm9l?=, Aug 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,035
    Travis Murray
    Aug 24, 2004
  2. Mohit
    Replies:
    1
    Views:
    4,258
    JH Trauntvein
    Jan 19, 2005
  3. sam
    Replies:
    10
    Views:
    731
    Howard
    May 6, 2005
  4. Replies:
    1
    Views:
    1,500
    Roland de Ruiter
    Jun 15, 2006
  5. Ed
    Replies:
    10
    Views:
    45,997
    alok000707
    Jul 13, 2010
Loading...

Share This Page