Retrieving fstream filename?

R

Randy Yates

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'
%%%% <[email protected]> % *Time*, Electric Light Orchestra
http://home.earthlink.net/~yatescr
 
J

John Harrison

Randy Yates said:
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
 
T

Tom Widmer

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
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top