Retrieving fstream filename?

Discussion in 'C++' started by Randy Yates, Oct 15, 2004.

  1. Randy Yates

    Randy Yates Guest

    Is there any way to get the filename with which a stream was opened? I don't
    see anything obvious in the stream API.
    --
    % Randy Yates % "Ticket to the moon, flight leaves here today
    %% Fuquay-Varina, NC % from Satellite 2"
    %%% 919-577-9882 % 'Ticket To The Moon'
    %%%% <> % *Time*, Electric Light Orchestra
    http://home.earthlink.net/~yatescr
    Randy Yates, Oct 15, 2004
    #1
    1. Advertising

  2. "Randy Yates" <> wrote in message
    news:...
    > Is there any way to get the filename with which a stream was opened? I
    > don't
    > see anything obvious in the stream API.


    No there isn't.

    john
    John Harrison, Oct 15, 2004
    #2
    1. Advertising

  3. Randy Yates

    Tom Widmer Guest

    On Fri, 15 Oct 2004 05:33:16 GMT, Randy Yates <> wrote:

    >Is there any way to get the filename with which a stream was opened? I don't
    >see anything obvious in the stream API.


    No, you'll have to derive a class from fstream (slightly dangerous
    since the "open" member isn't virtual), or create a class that holds
    the filename and an fstream.

    Tom
    Tom Widmer, Oct 15, 2004
    #3
    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,002
    Travis Murray
    Aug 24, 2004
  2. Armando
    Replies:
    6
    Views:
    735
    Armando
    Jan 29, 2004
  3. DellBoy
    Replies:
    6
    Views:
    9,531
    joshtm
    Dec 9, 2008
  4. Replies:
    1
    Views:
    1,431
    Roland de Ruiter
    Jun 15, 2006
  5. Ed
    Replies:
    10
    Views:
    45,728
    alok000707
    Jul 13, 2010
Loading...

Share This Page